A singleton class to manage all recognized routes in the system.
This class is used internally to allow managing routes. It should not be used by the public.
| deprecated |
This class will be renamed/reworied in a subsequent version |
|---|---|
| internal | |
| package |
CMS |
| license |
GPL |
| author |
Robert Campbell calguy1000@cmsmadesimple.org |
| since | 1.9 |
route_exists(\CmsRoute $route, boolean $static_only = FALSE) : boolean
\CmsRoute $routeThe route object
boolean $static_onlyA flag indicating that only static routes should be checked.
boolean
find_match(string $str, boolean $exact = false, boolean $static_only = FALSE) : \CmsRoute
string $strThe string to test against (usually an incoming url request)
boolean $exactPerform an exact string match rather than a regex match.
boolean $static_onlyA flag indicating that only static routes should be checked.
the matching route, or null.
add_static(\CmsRoute &$route) : boolean
This method will return TRUE, and do nothing if the route already exists. The route cache will be removed if the route is successfully added to the database.
\CmsRoute $routeThe route to add.
boolean
del_static(string $term, string $key1 = null, string $key2 = null, string $key3 = null) : boolean
The route cache will be removed if the route is successfully removed from the database.
string $termThe term to search for
string $key1string $key2string $key3 boolean
add_dynamic(\CmsRoute $route) : \bool.
Dynamic routes are not stored to the database, and are checked after static routes when searching for a match. This method will return TRUE if the route already exists (static, or dynamic)
\CmsRoute $routeThe dynamic route object to add
\bool.
register(\CmsRoute $route) : boolean
This is just an alias (for compatibility reasons) to the add_dynamc method.
\CmsRoute $routeThe route to register
boolean
load_routes()
typically called by modules or places where static urls are added this method will load all modules and call setparameters to ensure that their dynamic routes are created.