1 | <?php declare(strict_types=1); |
||
24 | class RoutingBase { |
||
25 | |||
26 | use \Aviat\Ion\StringWrapper; |
||
27 | |||
28 | /** |
||
29 | * Injection Container |
||
30 | * @var ContainerInterface $container |
||
31 | */ |
||
32 | protected $container; |
||
33 | |||
34 | /** |
||
35 | * Config Object |
||
36 | * @var Config |
||
37 | */ |
||
38 | protected $config; |
||
39 | |||
40 | /** |
||
41 | * Routing array |
||
42 | * @var array |
||
43 | */ |
||
44 | protected $routes; |
||
45 | |||
46 | /** |
||
47 | * Route configuration options |
||
48 | * @var array |
||
49 | */ |
||
50 | protected $route_config; |
||
51 | |||
52 | /** |
||
53 | * Constructor |
||
54 | * |
||
55 | * @param ContainerInterface $container |
||
56 | */ |
||
57 | public function __construct(ContainerInterface $container) |
||
65 | |||
66 | /** |
||
67 | * Retreive the appropriate value for the routing key |
||
68 | * |
||
69 | * @param string $key |
||
70 | * @return mixed |
||
71 | */ |
||
72 | public function __get($key) |
||
81 | |||
82 | /** |
||
83 | * Get the current url path |
||
84 | * |
||
85 | * @return string |
||
86 | */ |
||
87 | public function path() |
||
99 | |||
100 | /** |
||
101 | * Get the url segments |
||
102 | * |
||
103 | * @return array |
||
104 | */ |
||
105 | public function segments() |
||
110 | |||
111 | /** |
||
112 | * Get a segment of the current url |
||
113 | * |
||
114 | * @param int $num |
||
115 | * @return string|null |
||
116 | */ |
||
117 | public function get_segment($num) |
||
122 | |||
123 | /** |
||
124 | * Retrieve the last url segment |
||
125 | * |
||
126 | * @return string |
||
127 | */ |
||
128 | public function last_segment() |
||
133 | } |
||
134 | // End of RoutingBase.php |