mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-09 04:52:42 +00:00
Call parent::__construct so helpers are available.
This commit is contained in:
parent
6e1b1df2b2
commit
cff980b45d
1 changed files with 1 additions and 3 deletions
|
@ -62,10 +62,8 @@ class JsonView extends View {
|
||||||
* @param Controller $controller
|
* @param Controller $controller
|
||||||
*/
|
*/
|
||||||
public function __construct($controller) {
|
public function __construct($controller) {
|
||||||
|
parent::__construct($controller);
|
||||||
if (is_object($controller)) {
|
if (is_object($controller)) {
|
||||||
foreach (array('viewVars', 'viewPath', 'view', 'response') as $var) {
|
|
||||||
$this->{$var} = $controller->{$var};
|
|
||||||
}
|
|
||||||
$this->response->type('json');
|
$this->response->type('json');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue