mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-19 09:54:07 +08:00
29 lines
647 B
PHP
29 lines
647 B
PHP
<?php
|
|
|
|
use yii\helpers\Inflector;
|
|
|
|
/**
|
|
* This is the template for generating a controller class file.
|
|
*
|
|
* @var yii\base\View $this
|
|
* @var yii\gii\generators\controller\Generator $generator
|
|
*/
|
|
|
|
echo "<?php\n";
|
|
?>
|
|
|
|
<?php if (!empty($generator->ns)): ?>
|
|
namespace <?php echo $generator->ns; ?>;
|
|
<?php endif; ?>
|
|
|
|
class <?php echo $generator->getControllerClass(); ?> extends <?php echo '\\' . trim($generator->baseClass, '\\') . "\n"; ?>
|
|
{
|
|
<?php foreach($generator->getActionIDs() as $action): ?>
|
|
public function action<?php echo Inflector::id2camel($action); ?>()
|
|
{
|
|
return $this->render('<?php echo $action; ?>');
|
|
}
|
|
|
|
<?php endforeach; ?>
|
|
}
|