File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 88 */
99class AbstractRouter
1010{
11+ /** @var mixed Template engine's object */
12+ public $ tplEngine ;
1113 /** @var array */
1214 protected $ routes ;
1315 /** @var string */
1416 protected $ type ;
1517 /** @var string|array */
1618 protected $ output ;
1719
20+ /**
21+ * AbstractRouter constructor.
22+ * @param array $params
23+ */
24+ public function __construct (array $ params )
25+ {
26+ if ($ params ['tplEngine ' ]) {
27+ $ this ->tplEngine = $ params ['tplEngine ' ];
28+ }
29+ }
30+
1831 /**
1932 * @param string $path
2033 * @param string $class
@@ -80,7 +93,7 @@ protected function executeRoute()
8093 $ action = $ activeRoute ['action ' ];
8194 $ this ->type = $ activeRoute ['type ' ];
8295
83- $ this ->output = $ class ::$ action ();
96+ $ this ->output = $ class ::$ action ($ this -> tplEngine );
8497 }
8598
8699 /**
You can’t perform that action at this time.
0 commit comments