Skip to content
Permalink
Browse files

Removing extra if() that are not needed

as __loadController will stop() execution on error.
  • Loading branch information...
markstory committed Jun 5, 2009
1 parent bb566c3 commit 7cf7a0440c205e6390025acbcb78b517f18005dc
Showing with 16 additions and 18 deletions.
  1. +16 −18 cake/console/libs/tasks/view.php
@@ -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);
}
}
}

0 comments on commit 7cf7a04

Please sign in to comment.
You can’t perform that action at this time.