1 | <?php |
||
11 | class UriMatcher implements MatcherInterface |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * @var |
||
16 | */ |
||
17 | private $router; |
||
18 | |||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | private $matcher = ['matchController','matchTemplate']; |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | private $dispatcher = [ |
||
29 | 'matchTemplate' => 'JetFire\Routing\Dispatcher\TemplateDispatcher', |
||
30 | 'matchController' => 'JetFire\Routing\Dispatcher\ControllerDispatcher' |
||
31 | ]; |
||
32 | |||
33 | /** |
||
34 | * @param Router $router |
||
35 | */ |
||
36 | public function __construct(Router $router) |
||
40 | |||
41 | /** |
||
42 | * @param string $matcher |
||
43 | */ |
||
44 | public function addMatcher($matcher){ |
||
47 | |||
48 | /** |
||
49 | * @return array |
||
50 | */ |
||
51 | public function getMatcher() |
||
55 | |||
56 | /** |
||
57 | * @param array $dispatcher |
||
58 | */ |
||
59 | public function setDispatcher($dispatcher = []) |
||
63 | |||
64 | /** |
||
65 | * @param $method |
||
66 | * @param $class |
||
67 | * @return mixed|void |
||
68 | */ |
||
69 | public function addDispatcher($method,$class){ |
||
72 | |||
73 | /** |
||
74 | * @return bool |
||
75 | */ |
||
76 | public function match() |
||
86 | |||
87 | /** |
||
88 | * @return bool |
||
89 | */ |
||
90 | public function matchTemplate() |
||
114 | |||
115 | /** |
||
116 | * @return bool |
||
117 | */ |
||
118 | public function matchController() |
||
147 | |||
148 | } |
||
149 |