diff options
Diffstat (limited to 'lib/Minz/ActionController.php')
| -rw-r--r-- | lib/Minz/ActionController.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Minz/ActionController.php b/lib/Minz/ActionController.php index 8cc9fbc0b..c9551a016 100644 --- a/lib/Minz/ActionController.php +++ b/lib/Minz/ActionController.php @@ -28,11 +28,14 @@ class Minz_ActionController { public function __construct () { $this->csp_policies = self::$csp_default; + $view = null; if (class_exists(self::$viewType)) { - $this->view = new self::$viewType(); - } else { - $this->view = new Minz_View(); + $view = new self::$viewType(); + if (!($view instanceof Minz_View)) { + $view = null; + } } + $this->view = $view ?? new Minz_View(); $view_path = Minz_Request::controllerName() . '/' . Minz_Request::actionName() . '.phtml'; $this->view->_path($view_path); $this->view->attributeParams (); |
