mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Checking types before calling methods.
This commit is contained in:
parent
cff980b45d
commit
168c6f14c2
2 changed files with 3 additions and 3 deletions
|
@ -63,8 +63,8 @@ class JsonView extends View {
|
||||||
*/
|
*/
|
||||||
public function __construct($controller) {
|
public function __construct($controller) {
|
||||||
parent::__construct($controller);
|
parent::__construct($controller);
|
||||||
if (is_object($controller)) {
|
if (isset($controller->response) && $controller->response instanceof CakeResponse) {
|
||||||
$this->response->type('json');
|
$controller->response->type('json');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ class XmlView extends View {
|
||||||
public function __construct($controller) {
|
public function __construct($controller) {
|
||||||
parent::__construct($controller);
|
parent::__construct($controller);
|
||||||
|
|
||||||
if (is_object($controller)) {
|
if (isset($controller->response) && $controller->response instanceof CakeResponse) {
|
||||||
$controller->response->type('xml');
|
$controller->response->type('xml');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue