Commit 9a4f4f85 by Qiang Xue

wip

parent 3b610926
<?php
require(__DIR__ . '/../../../framework/yii.php');
$application = new yii\web\Application('test', __DIR__ . '/protected');
$application->run();
<?php
return array();
\ No newline at end of file
<?php
use yii\util\Html;
class DefaultController extends \yii\web\Controller
{
public function actionIndex()
{
echo 'hello world';
}
public function actionForm()
{
echo Html::beginForm();
echo Html::checkboxList('test', array(
'value 1' => 'item 1',
'value 2' => 'item 2',
'value 3' => 'item 3',
), isset($_POST['test']) ? $_POST['test'] : null,
function ($index, $label, $name, $value, $checked) {
return Html::label(
$label . ' ' . Html::checkbox($name, $value, $checked),
null, array('class' => 'inline checkbox')
);
});
echo Html::submitButton();
echo Html::endForm();
print_r($_POST);
}
}
\ No newline at end of file
<?php
/**
* Created by JetBrains PhpStorm.
* User: qiang
* Date: 3/16/13
* Time: 10:41 AM
* To change this template use File | Settings | File Templates.
*/
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment