Skip to content

Commit d501b63

Browse files
authored
Update AbstractRouter.php
1 parent c39a171 commit d501b63

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/AbstractRouter.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,26 @@
88
*/
99
class 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
/**

0 commit comments

Comments
 (0)