Refactoring controller rendering to use the CakeResponse object

This commit is contained in:
José Lorenzo Rodríguez 2010-08-01 01:38:45 -04:30
parent 0824348db1
commit 077f71aaa1
2 changed files with 7 additions and 7 deletions

View file

@ -195,19 +195,19 @@ class Dispatcher {
'base' => $request->base
)));
}
$output = call_user_func_array(array(&$controller, $request->params['action']), $request->params['pass']);
$output =& call_user_func_array(array(&$controller, $request->params['action']), $request->params['pass']);
if ($controller->autoRender) {
$controller->output = $controller->render();
} elseif (empty($controller->output)) {
$controller->output = $output;
$controller->render();
} elseif ($this->response->body() === null) {
$this->response->body($output);
}
$controller->shutdownProcess();
if (isset($request->params['return'])) {
return $controller->output;
return $this->response->body();
}
echo($controller->output);
$this->response->send();
}
/**

View file

@ -826,7 +826,7 @@ class Controller extends Object {
}
$this->autoRender = false;
return $View->render($action, $layout, $file);
return $this->response->body($View->render($action, $layout, $file));
}
/**