class Router implements RouterInterface
The global router class
Methods
__construct(string $route = null, array $routes_table = array(), array $arguments_table = array(), array $matchers_table = array())
Construction |
||
Collection |
getCollection(array $collection)
Get a collection object if it was not |
|
Router |
setUrl(string $url)
Set the current URL |
|
string |
getUrl()
Get the current URL |
|
Router |
setRoute(string $route)
Set the current route |
|
string |
getRoute()
Get the current route |
|
Router |
setRouteParsed(array $infos)
Set the current route parsed infos |
|
array |
getRouteParsed()
Get the current route parsed infos |
|
Router |
setRoutes(Collection $collection)
Set the routes collection |
|
Collection |
getRoutes()
Get the routes collection |
|
Router |
setArgumentsMap(Collection $collection)
Set the arguments correspondances table like ( true arg in URL => true arg name in the app ) |
|
Collection |
getArgumentsMap()
Get the arguments table |
|
Router |
setMatchers(Collection $collection)
Set a collection of masks to parse and match a route URL |
|
Collection |
getMatchers()
Get the route matcher |
|
bool |
routeExists(string $route)
Check if a route exists |
|
string |
generateUrl(mixed $route_infos, string $base_uri = null, string $hash = null, string $separator = '&')
Build a new route URL |
|
false|mixed |
matchUrl(mixed $pathinfo)
Test if an URL has a corresponding route |
|
Router |
distribute()
Actually dispatch the current route |
|
void |
forward(mixed $pathinfo, string $hash = null)
Forward the application to a new route (no HTTP redirect) |
|
void |
redirect(mixed $pathinfo, string $hash = null)
Make a redirection to a new route (HTTP redirect) |
|
static string |
urlEncode(string $str = null, bool $keep_mask = true)
Special 'urlencode' function to only encode strings and let any "%s" mask not encoded |
Details
at line 78
public
__construct(string $route = null, array $routes_table = array(), array $arguments_table = array(), array $matchers_table = array())
Construction
at line 101
public Collection
getCollection(array $collection)
Get a collection object if it was not
at line 120
public Router
setUrl(string $url)
Set the current URL
at line 131
public string
getUrl()
Get the current URL
at line 142
public Router
setRoute(string $route)
Set the current route
at line 153
public string
getRoute()
Get the current route
at line 164
public Router
setRouteParsed(array $infos)
Set the current route parsed infos
at line 175
public array
getRouteParsed()
Get the current route parsed infos
at line 186
public Router
setRoutes(Collection $collection)
Set the routes collection
at line 197
public Collection
getRoutes()
Get the routes collection
at line 208
public Router
setArgumentsMap(Collection $collection)
Set the arguments correspondances table like ( true arg in URL => true arg name in the app )
at line 219
public Collection
getArgumentsMap()
Get the arguments table
at line 230
public Router
setMatchers(Collection $collection)
Set a collection of masks to parse and match a route URL
at line 241
public Collection
getMatchers()
Get the route matcher
at line 252
public bool
routeExists(string $route)
Check if a route exists
at line 317
public string
generateUrl(mixed $route_infos, string $base_uri = null, string $hash = null, string $separator = '&')
Build a new route URL
The class will pass arguments values to any $this->toUrlParam($value)
method for the
parameter named param
.
at line 354
public false|mixed
matchUrl(mixed $pathinfo)
Test if an URL has a corresponding route
at line 369
public Router
distribute()
Actually dispatch the current route
at line 392
public void
forward(mixed $pathinfo, string $hash = null)
Forward the application to a new route (no HTTP redirect)
at line 403
public void
redirect(mixed $pathinfo, string $hash = null)
Make a redirection to a new route (HTTP redirect)
at line 430
static public string
urlEncode(string $str = null, bool $keep_mask = true)
Special 'urlencode' function to only encode strings and let any "%s" mask not encoded