Skip to content

Commit

Permalink
Starting to change how Controller::render() and response
Browse files Browse the repository at this point in the history
objects are handled.
  • Loading branch information
markstory committed Jul 23, 2011
1 parent 65d28f4 commit b0749ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/Cake/Controller/Controller.php
Expand Up @@ -828,7 +828,8 @@ public function render($view = null, $layout = null) {

$this->autoRender = false;
$this->View = $View;
return $this->response->body($View->render($view, $layout));
$this->response->body($View->render($view, $layout));
return $this->response;
}

/**
Expand Down
5 changes: 4 additions & 1 deletion lib/Cake/Routing/Dispatcher.php
Expand Up @@ -151,8 +151,11 @@ protected function _invoke(Controller $controller, CakeRequest $request, CakeRes
}
$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);
}
Expand Down

0 comments on commit b0749ac

Please sign in to comment.