1 | <?php |
||
8 | trait RouteBuilderTrait |
||
9 | { |
||
10 | /** |
||
11 | * Creates a new route with http scheme |
||
12 | * @param string $path |
||
13 | * @param mixed $action |
||
14 | * @return Route |
||
15 | */ |
||
16 | public function http($path, $action) |
||
20 | |||
21 | /** |
||
22 | * Creates a new route with https scheme |
||
23 | * @param string $path |
||
24 | * @param mixed $action |
||
25 | * @return Route |
||
26 | */ |
||
27 | public function https($path, $action) |
||
31 | |||
32 | /** |
||
33 | * Creates a new GET route |
||
34 | * @param string $path |
||
35 | * @param mixed $action |
||
36 | * @return Route |
||
37 | */ |
||
38 | public function get($path, $action) |
||
45 | |||
46 | /** |
||
47 | * Creates a new POST route |
||
48 | * @param string $path |
||
49 | * @param mixed $action |
||
50 | * @return Route |
||
51 | */ |
||
52 | public function post($path, $action) |
||
58 | |||
59 | /** |
||
60 | * Creates a new PUT route |
||
61 | * @param string $path |
||
62 | * @param mixed $action |
||
63 | * @return Route |
||
64 | */ |
||
65 | public function put($path, $action) |
||
71 | |||
72 | /** |
||
73 | * Creates a new PATCH route |
||
74 | * @param string $path |
||
75 | * @param mixed $action |
||
76 | * @return Route |
||
77 | */ |
||
78 | public function patch($path, $action) |
||
84 | |||
85 | /** |
||
86 | * Creates a new DELETE route |
||
87 | * @param string $path |
||
88 | * @param mixed $action |
||
89 | * @return Route |
||
90 | */ |
||
91 | public function delete($path, $action) |
||
97 | |||
98 | /** |
||
99 | * Creates a new route and registries it to the collection |
||
100 | * @param string $path |
||
101 | * @param mixed $action |
||
102 | * @return Route |
||
103 | */ |
||
104 | public function create($path, $action) |
||
110 | |||
111 | /** |
||
112 | * Add a route to the collection |
||
113 | * @param Route $route |
||
114 | * @return Route |
||
115 | */ |
||
116 | abstract public function add(Route $route); |
||
117 | } |