controller.php 622 Bytes
Newer Older
Qiang Xue committed
1
<?php
2 3 4

use yii\helpers\Inflector;

Qiang Xue committed
5
/**
Qiang Xue committed
6 7
 * This is the template for generating a controller class file.
 *
Alexander Makarov committed
8
 * @var yii\web\View $this
Qiang Xue committed
9
 * @var yii\gii\generators\controller\Generator $generator
Qiang Xue committed
10
 */
11 12

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

<?php if (!empty($generator->ns)): ?>
Alexander Makarov committed
16
namespace <?= $generator->ns ?>;
Qiang Xue committed
17 18
<?php endif; ?>

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

<?php endforeach; ?>
}