Starting to change how Controller::render() and response

objects are handled.
This commit is contained in:
mark_story 2011-07-06 20:41:38 -04:00 committed by mark_story
parent 65d28f4c73
commit b0749acbb6
2 changed files with 6 additions and 2 deletions

View file

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

View file

@ -151,8 +151,11 @@ class Dispatcher {
}
$result = call_user_func_array(array(&$controller, $request->params['action']), $request->params['pass']);
if ($result instanceof CakeResponse) {
$response = $result;
}
if ($controller->autoRender) {
$controller->render();
$response = $controller->render();
} elseif ($response->body() === null) {
$response->body($result);
}