1 | <?php |
||
15 | class Routes |
||
16 | { |
||
17 | public $routes = [ |
||
18 | |||
19 | ]; |
||
20 | |||
21 | /** |
||
22 | * @param $routeName |
||
23 | * @param $controller |
||
24 | * @param $method |
||
25 | */ |
||
26 | function make($routeName, $controller, $method) |
||
|
|||
27 | { |
||
28 | $this->routes[$routeName] = (object) [ |
||
29 | 'controller'=>$controller, |
||
30 | 'method'=>$method, |
||
31 | 'route'=>$routeName, |
||
32 | // 'auth'=> $authenticated |
||
33 | ]; |
||
34 | } |
||
35 | |||
36 | function getRoutes() |
||
40 | } |
||
41 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.