controller.php 642 Bytes
Newer Older
Qiang Xue committed
1 2
<?php
/**
Qiang Xue committed
3
 * This is the template for generating a controller class file.
Qiang Xue committed
4
 */
5

6
use yii\helpers\Inflector;
7
use yii\helpers\StringHelper;
8 9 10 11

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\controller\Generator */

12
echo "<?php\n";
Qiang Xue committed
13 14
?>

15
namespace <?= $generator->getControllerNamespace() ?>;
Qiang Xue committed
16

17
class <?= StringHelper::basename($generator->controllerClass) ?> extends <?= '\\' . trim($generator->baseClass, '\\') . "\n" ?>
Qiang Xue committed
18
{
Alexander Mohorev committed
19
<?php foreach ($generator->getActionIDs() as $action): ?>
20 21 22 23
    public function action<?= Inflector::id2camel($action) ?>()
    {
        return $this->render('<?= $action ?>');
    }
Qiang Xue committed
24 25 26

<?php endforeach; ?>
}