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

use yii\helpers\Inflector;

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

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

<?php if (!empty($generator->ns)): ?>
namespace <?php echo $generator->ns; ?>;
<?php endif; ?>

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

<?php endforeach; ?>
}