diff --git a/lib/Cake/Console/Templates/default/actions/controller_actions.ctp b/lib/Cake/Console/Templates/default/actions/controller_actions.ctp index c0921c2c4..e34c382d5 100644 --- a/lib/Cake/Console/Templates/default/actions/controller_actions.ctp +++ b/lib/Cake/Console/Templates/default/actions/controller_actions.ctp @@ -31,6 +31,7 @@ /** * <?php echo $admin ?>view method * + * @throws NotFoundException * @param string $id * @return void */ @@ -85,6 +86,7 @@ /** * <?php echo $admin ?>edit method * + * @throws NotFoundException * @param string $id * @return void */ @@ -129,6 +131,8 @@ /** * <?php echo $admin ?>delete method * + * @throws MethodNotAllowedException + * @throws NotFoundException * @param string $id * @return void */ @@ -154,4 +158,4 @@ $this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> was not deleted'), array('action' => 'index')); <?php endif; ?> $this->redirect(array('action' => 'index')); - } \ No newline at end of file + } diff --git a/lib/Cake/Console/Templates/default/classes/controller.ctp b/lib/Cake/Console/Templates/default/classes/controller.ctp index 741e06b00..6e27d0d19 100644 --- a/lib/Cake/Console/Templates/default/classes/controller.ctp +++ b/lib/Cake/Console/Templates/default/classes/controller.ctp @@ -46,36 +46,36 @@ class <?php echo $controllerName; ?>Controller extends <?php echo $plugin; ?>App * @var mixed */ public $scaffold; -<?php else: ?> -<?php -if (count($helpers)): - echo "/**\n * Helpers\n *\n * @var array\n */\n"; - echo "\tpublic \$helpers = array("; - for ($i = 0, $len = count($helpers); $i < $len; $i++): - if ($i != $len - 1): - echo "'" . Inflector::camelize($helpers[$i]) . "', "; - else: - echo "'" . Inflector::camelize($helpers[$i]) . "'"; - endif; - endfor; - echo ");\n"; -endif; -if (count($components)): - echo "/**\n * Components\n *\n * @var array\n */\n"; - echo "\tpublic \$components = array("; - for ($i = 0, $len = count($components); $i < $len; $i++): - if ($i != $len - 1): - echo "'" . Inflector::camelize($components[$i]) . "', "; - else: - echo "'" . Inflector::camelize($components[$i]) . "'"; - endif; - endfor; - echo ");\n"; -endif; +<?php else: -echo $actions; + if (count($helpers)): + echo "/**\n * Helpers\n *\n * @var array\n */\n"; + echo "\tpublic \$helpers = array("; + for ($i = 0, $len = count($helpers); $i < $len; $i++): + if ($i != $len - 1): + echo "'" . Inflector::camelize($helpers[$i]) . "', "; + else: + echo "'" . Inflector::camelize($helpers[$i]) . "'"; + endif; + endfor; + echo ");\n\n"; + endif; + + if (count($components)): + echo "/**\n * Components\n *\n * @var array\n */\n"; + echo "\tpublic \$components = array("; + for ($i = 0, $len = count($components); $i < $len; $i++): + if ($i != $len - 1): + echo "'" . Inflector::camelize($components[$i]) . "', "; + else: + echo "'" . Inflector::camelize($components[$i]) . "'"; + endif; + endfor; + echo ");\n\n"; + endif; + + echo trim($actions) . "\n"; endif; ?> - }