Skip to content

Commit

Permalink
baked controller code generates no errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed May 9, 2012
1 parent 8060dd5 commit 5b50763
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 29 deletions.
Expand Up @@ -31,6 +31,7 @@
/**
* <?php echo $admin ?>view method
*
* @throws NotFoundException
* @param string $id
* @return void
*/
Expand Down Expand Up @@ -85,6 +86,7 @@
/**
* <?php echo $admin ?>edit method
*
* @throws NotFoundException
* @param string $id
* @return void
*/
Expand Down Expand Up @@ -129,6 +131,8 @@
/**
* <?php echo $admin ?>delete method
*
* @throws MethodNotAllowedException
* @throws NotFoundException
* @param string $id
* @return void
*/
Expand All @@ -154,4 +158,4 @@
$this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> was not deleted'), array('action' => 'index'));
<?php endif; ?>
$this->redirect(array('action' => 'index'));
}
}
56 changes: 28 additions & 28 deletions lib/Cake/Console/Templates/default/classes/controller.ctp
Expand Up @@ -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;

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; ?>
}

0 comments on commit 5b50763

Please sign in to comment.