Skip to content

Commit 80f9e6f

Browse files
committed
Finishing refactor on View task to use _methodsToBake
1 parent 9d0d314 commit 80f9e6f

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

cake/console/libs/tasks/view.php

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -135,30 +135,9 @@ function execute() {
135135
} else {
136136
$vars = $this->__loadController();
137137
$methods = $this->_methodsToBake();
138-
$methods = array_diff(
139-
array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
140-
array_map('strtolower', get_class_methods('appcontroller'))
141-
);
142-
if (empty($methods)) {
143-
$methods = $this->scaffoldActions;
144-
}
145-
$adminRoute = Configure::read('Routing.admin');
146-
if ($adminRoute && isset($this->params['admin'])) {
147-
foreach ($methods as $i => $method) {
148-
if (strpos($method, $adminRoute . '_') === false) {
149-
unset($methods[$i]);
150-
}
151-
}
152-
}
153-
$adminDelete = null;
154-
if (!empty($adminRoute)) {
155-
$adminDelete = $adminRoute . '_delete';
156-
}
157138
foreach ($methods as $method) {
158-
if ($method{0} != '_' && !in_array($method, array('delete', $adminDelete))) {
159-
$content = $this->getContent($method, $vars);
160-
$this->bake($method, $content);
161-
}
139+
$content = $this->getContent($method, $vars);
140+
$this->bake($method, $content);
162141
}
163142
}
164143
}
@@ -179,7 +158,7 @@ function _methodsToBake() {
179158
}
180159
$adminRoute = Configure::read('Routing.admin');
181160
foreach ($methods as $i => $method) {
182-
if ($method == 'delete' || $method = $adminRoute . '_delete' || $method{0} == '_') {
161+
if ($method == 'delete' || $method == $adminRoute . '_delete' || $method{0} == '_') {
183162
unset($methods[$i]);
184163
}
185164
if ($adminRoute && isset($this->params['admin']) && strpos($method, $adminRoute . '_') === false) {

0 commit comments

Comments
 (0)