You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
648 B

12 years ago
<?php
use yii\helpers\Html;
12 years ago
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',
12 years ago
), isset($_POST['test']) ? $_POST['test'] : null,
12 years ago
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);
}
}