| @@ -103,16 +103,23 @@ | ||
| 103 | 103 | public function __construct($hasView = null, $request = null) { |
| 104 | 104 | // Initialize hookable! |
| 105 | 105 | parent::__construct(); |
| 106 | 106 | // Read request parameters. |
| 107 | - $this->request = $request ? $request : $_REQUEST; | |
| 107 | + $this->request = array_merge(((array) $_REQUEST), ((array) $request)); | |
| 108 | 108 | // Create default model. |
| 109 | 109 | if (isset($this->controllerInfo['model'])) { |
| 110 | + // E_ALL complain! | |
| 111 | + if (!isset($this->controllerInfo['model_file'])) { | |
| 112 | + $this->controllerInfo['model_file'] = null; | |
| 113 | + } | |
| 110 | 114 | $this->model = CJTModel::create($this->controllerInfo['model'], array(), $this->controllerInfo['model_file']); |
| 111 | 115 | } |
| 112 | 116 | // Create default view. |
| 113 | 117 | if ($hasView === null) { // Default value for $hasView = true |
| 114 | - $view = $this->ongetviewname($this->request['view'] ? $this->request['view'] : $this->controllerInfo['view']); | |
| 118 | + // Request/passed parameters has priority over controller default view! | |
| 119 | + $view = $this->ongetviewname(isset($this->request['view']) ? $this->request['view'] : | |
| 120 | + (isset($this->controllerInfo['view']) ? $this->controllerInfo['view'] : null) | |
| 121 | + ); | |
| 115 | 122 | if ($view) { |
| 116 | 123 | $this->view = self::getView($view) |
| 117 | 124 | // Push data into view. |
| 118 | 125 | ->setModel($this->model) |