Qiang Xue
12 years ago
4 changed files with 47 additions and 0 deletions
@ -0,0 +1,6 @@
|
||||
<?php |
||||
|
||||
require(__DIR__ . '/../../../framework/yii.php'); |
||||
|
||||
$application = new yii\web\Application('test', __DIR__ . '/protected'); |
||||
$application->run(); |
@ -0,0 +1,30 @@
|
||||
<?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); |
||||
} |
||||
} |
Loading…
Reference in new issue