Browse code

Application obj injection into new controller obj

RafaƂ Szklarczyk authored on 04/06/2019 22:20:15
Showing 1 changed files
... ...
@@ -137,7 +137,7 @@ class Application{
137 137
                 .$controller;
138 138
             
139 139
             if(class_exists($controller_class,true)){
140
-                $controller_object = new $controller_class;
140
+                $controller_object = new $controller_class($this);
141 141
             }
142 142
             else{
143 143
                 return $this->handle404($this->request);
... ...
@@ -157,7 +157,7 @@ class Application{
157 157
             
158 158
             // method not found - 404
159 159
             if(!method_exists($controller_object,$controller_action)){
160
-                $this->handle404($this->request);
160
+                return $this->handle404($this->request);
161 161
             }
162 162
 
163 163
             $this->module = $module;