mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Starting to change how Controller::render() and response
objects are handled.
This commit is contained in:
parent
65d28f4c73
commit
b0749acbb6
2 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue