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.
29 lines
649 B
29 lines
649 B
11 years ago
|
<?php
|
||
11 years ago
|
|
||
|
use yii\helpers\Inflector;
|
||
|
|
||
11 years ago
|
/**
|
||
11 years ago
|
* This is the template for generating an action view file.
|
||
|
*
|
||
|
* @var yii\base\View $this
|
||
|
* @var yii\gii\generators\form\Generator $generator
|
||
11 years ago
|
*/
|
||
11 years ago
|
|
||
|
echo "<?php\n";
|
||
11 years ago
|
?>
|
||
11 years ago
|
|
||
11 years ago
|
public function action<?= Inflector::id2camel(trim(basename($generator->viewName), '_')) ?>()
|
||
11 years ago
|
{
|
||
11 years ago
|
$model = new <?= $generator->modelClass ?><?= empty($generator->scenarioName) ? "" : "(['scenario' => '{$generator->scenarioName}'])" ?>;
|
||
11 years ago
|
|
||
|
if ($model->load($_POST)) {
|
||
11 years ago
|
if ($model->validate()) {
|
||
11 years ago
|
// form inputs are valid, do something here
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
11 years ago
|
return $this->render('<?= $generator->viewName ?>', [
|
||
11 years ago
|
'model' => $model,
|
||
11 years ago
|
]);
|
||
11 years ago
|
}
|