controller.php 1020 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * This is the template for generating a controller class file.
  4. * The following variables are available in this template:
  5. * - $this: the ControllerCode object
  6. */
  7. ?>
  8. <?php echo "<?php\n"; ?>
  9. class <?php echo $this->controllerClass; ?> extends <?php echo $this->baseClass."\n"; ?>
  10. {
  11. <?php foreach($this->getActionIDs() as $action): ?>
  12. public function action<?php echo ucfirst($action); ?>()
  13. {
  14. $this->render('<?php echo $action; ?>');
  15. }
  16. <?php endforeach; ?>
  17. // Uncomment the following methods and override them if needed
  18. /*
  19. public function filters()
  20. {
  21. // return the filter configuration for this controller, e.g.:
  22. return array(
  23. 'inlineFilterName',
  24. array(
  25. 'class'=>'path.to.FilterClass',
  26. 'propertyName'=>'propertyValue',
  27. ),
  28. );
  29. }
  30. public function actions()
  31. {
  32. // return external action classes, e.g.:
  33. return array(
  34. 'action1'=>'path.to.ActionClass',
  35. 'action2'=>array(
  36. 'class'=>'path.to.AnotherActionClass',
  37. 'propertyName'=>'propertyValue',
  38. ),
  39. );
  40. }
  41. */
  42. }