Browse Source

wip

tags/2.0.0-alpha
Qiang Xue 12 years ago
parent
commit
9a4f4f85d2
  1. 6
      tests/web/app/index.php
  2. 3
      tests/web/app/protected/config/main.php
  3. 30
      tests/web/app/protected/controllers/SiteController.php
  4. 8
      tests/web/app/protected/views/site/index.php

6
tests/web/app/index.php

@ -0,0 +1,6 @@
<?php
require(__DIR__ . '/../../../framework/yii.php');
$application = new yii\web\Application('test', __DIR__ . '/protected');
$application->run();

3
tests/web/app/protected/config/main.php

@ -0,0 +1,3 @@
<?php
return array();

30
tests/web/app/protected/controllers/SiteController.php

@ -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);
}
}

8
tests/web/app/protected/views/site/index.php

@ -0,0 +1,8 @@
<?php
/**
* Created by JetBrains PhpStorm.
* User: qiang
* Date: 3/16/13
* Time: 10:41 AM
* To change this template use File | Settings | File Templates.
*/
Loading…
Cancel
Save