controller.php 606 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 21
{
<?php foreach($generator->getActionIDs() as $action): ?>
Alexander Makarov committed
22
	public function action<?= Inflector::id2camel($action) ?>()
Qiang Xue committed
23
	{
Alexander Makarov committed
24
		return $this->render('<?= $action ?>');
Qiang Xue committed
25 26 27 28
	}

<?php endforeach; ?>
}