mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Refactoring controller rendering to use the CakeResponse object
This commit is contained in:
parent
0824348db1
commit
077f71aaa1
2 changed files with 7 additions and 7 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue