1 | <?php |
||
8 | class RouteRegistrar |
||
9 | { |
||
10 | /** |
||
11 | * @var Router |
||
12 | */ |
||
13 | protected $router; |
||
14 | |||
15 | /** |
||
16 | * @var string controller to handle generic resources |
||
17 | */ |
||
18 | protected $controller; |
||
19 | |||
20 | /** |
||
21 | * Create a new RouteRegistrar instance. |
||
22 | * |
||
23 | * @param Router $router |
||
24 | */ |
||
25 | public function __construct(Router $router, $controller) |
||
30 | |||
31 | /** |
||
32 | * Add the resourceful routes for the given uri and resource. |
||
33 | * |
||
34 | * @param string $uri |
||
35 | * @param string $resource |
||
36 | * @param array $options |
||
37 | */ |
||
38 | public function addRoute($uri, $resource, array $options = []) |
||
59 | |||
60 | /** |
||
61 | * Get the options for the resource route. |
||
62 | * |
||
63 | * @param array $options |
||
64 | * @return array |
||
65 | */ |
||
66 | protected function routeOptions(array $options) |
||
75 | |||
76 | /** |
||
77 | * Get the options for the route group. |
||
78 | * |
||
79 | * @param string $resource |
||
80 | * @param array $options |
||
81 | * @return array |
||
82 | */ |
||
83 | protected function groupOptions($resource, array $options) |
||
87 | |||
88 | /** |
||
89 | * Get the name of the resource currently being accessed. |
||
90 | * |
||
91 | * @return string |
||
92 | */ |
||
93 | public function getCurrentResource() |
||
97 | } |
||
98 |