RouterInterface.php
4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<?php
namespace Phalcon\Mvc {
/**
* Phalcon\Mvc\RouterInterface initializer
*/
interface RouterInterface {
/**
* Sets the name of the default module
*
* @param string $moduleName
*/
public function setDefaultModule($moduleName);
/**
* Sets the default controller name
*
* @param string $controllerName
*/
public function setDefaultController($controllerName);
/**
* Sets the default action name
*
* @param string $actionName
*/
public function setDefaultAction($actionName);
/**
* Sets an array of default paths
*
* @param array $defaults
*/
public function setDefaults($defaults);
/**
* Handles routing information received from the rewrite engine
*
* @param string $uri
*/
public function handle($uri=null);
/**
* Adds a route to the router on any HTTP method
*
* @param string $pattern
* @param string/array $paths
* @param string $httpMethods
* @return \Phalcon\Mvc\Router\RouteInterface
*/
public function add($pattern, $paths=null, $httpMethods=null);
/**
* Adds a route to the router that only match if the HTTP method is GET
*
* @param string $pattern
* @param string/array $paths
* @return \Phalcon\Mvc\Router\RouteInterface
*/
public function addGet($pattern, $paths=null);
/**
* Adds a route to the router that only match if the HTTP method is POST
*
* @param string $pattern
* @param string/array $paths
* @return \Phalcon\Mvc\Router\RouteInterface
*/
public function addPost($pattern, $paths=null);
/**
* Adds a route to the router that only match if the HTTP method is PUT
*
* @param string $pattern
* @param string/array $paths
* @return \Phalcon\Mvc\Router\RouteInterface
*/
public function addPut($pattern, $paths=null);
/**
* Adds a route to the router that only match if the HTTP method is DELETE
*
* @param string $pattern
* @param string/array $paths
* @return \Phalcon\Mvc\Router\RouteInterface
*/
public function addDelete($pattern, $paths=null);
/**
* Add a route to the router that only match if the HTTP method is OPTIONS
*
* @param string $pattern
* @param string/array $paths
* @return \Phalcon\Mvc\Router\RouteInterface
*/
public function addOptions($pattern, $paths=null);
/**
* Adds a route to the router that only match if the HTTP method is HEAD
*
* @param string $pattern
* @param string/array $paths
* @return \Phalcon\Mvc\Router\RouteInterface
*/
public function addHead($pattern, $paths=null);
/**
* Removes all the defined routes
*/
public function clear();
/**
* Returns processed module name
*
* @return string
*/
public function getModuleName();
/**
* Returns processed controller name
*
* @return string
*/
public function getControllerName();
/**
* Returns processed action name
*
* @return string
*/
public function getActionName();
/**
* Returns processed extra params
*
* @return array
*/
public function getParams();
/**
* Returns the route that matchs the handled URI
*
* @return \Phalcon\Mvc\Router\RouteInterface
*/
public function getMatchedRoute();
/**
* Return the sub expressions in the regular expression matched
*
* @return array
*/
public function getMatches();
/**
* Check if the router macthes any of the defined routes
*
* @return bool
*/
public function wasMatched();
/**
* Return all the routes defined in the router
*
* @return \Phalcon\Mvc\Router\RouteInterface[]
*/
public function getRoutes();
/**
* Returns a route object by its id
*
* @param string $id
* @return \Phalcon\Mvc\Router\RouteInterface
*/
public function getRouteById($id);
/**
* Returns a route object by its name
*
* @param string $name
* @return \Phalcon\Mvc\Router\RouteInterface
*/
public function getRouteByName($name);
/**
* Returns whether controller name should not be mangled
*
* @return bool
*/
public function isExactControllerName();
}
}