Skip to content

Commit

Permalink
Removing extra if() that are not needed
Browse files Browse the repository at this point in the history
as __loadController will stop() execution on error.
  • Loading branch information
markstory committed Jun 5, 2009
1 parent bb566c3 commit 7cf7a04
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions cake/console/libs/tasks/view.php
Expand Up @@ -129,25 +129,23 @@ function execute() {
$this->bake($action, true);
} else {
$vars = $this->__loadController();
if ($vars) {
$methods = array_diff(
array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
array_map('strtolower', get_class_methods('appcontroller'))
);
if (empty($methods)) {
$methods = $this->scaffoldActions;
}
$adminDelete = null;
$methods = array_diff(
array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
array_map('strtolower', get_class_methods('appcontroller'))
);
if (empty($methods)) {
$methods = $this->scaffoldActions;
}
$adminDelete = null;

$adminRoute = Configure::read('Routing.admin');
if (!empty($adminRoute)) {
$adminDelete = $adminRoute . '_delete';
}
foreach ($methods as $method) {
if ($method{0} != '_' && !in_array($method, array('delete', $adminDelete))) {
$content = $this->getContent($method, $vars);
$this->bake($method, $content);
}
$adminRoute = Configure::read('Routing.admin');
if (!empty($adminRoute)) {
$adminDelete = $adminRoute . '_delete';
}
foreach ($methods as $method) {
if ($method{0} != '_' && !in_array($method, array('delete', $adminDelete))) {
$content = $this->getContent($method, $vars);
$this->bake($method, $content);
}
}
}
Expand Down

0 comments on commit 7cf7a04

Please sign in to comment.