You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
642B

  1. <?php
  2. /**
  3. * This is the template for generating a controller class file.
  4. */
  5. use yii\helpers\Inflector;
  6. use yii\helpers\StringHelper;
  7. /* @var $this yii\web\View */
  8. /* @var $generator yii\gii\generators\controller\Generator */
  9. echo "<?php\n";
  10. ?>
  11. namespace <?= $generator->getControllerNamespace() ?>;
  12. class <?= StringHelper::basename($generator->controllerClass) ?> extends <?= '\\' . trim($generator->baseClass, '\\') . "\n" ?>
  13. {
  14. <?php foreach ($generator->getActionIDs() as $action): ?>
  15. public function action<?= Inflector::id2camel($action) ?>()
  16. {
  17. return $this->render('<?= $action ?>');
  18. }
  19. <?php endforeach; ?>
  20. }