sfPatternRouting class controls the generation and parsing of URLs.
Method Summary
-
appendRoute($name, $route)
Adds a new route.
-
clearRoutes()
-
configureRoute($route)
-
array
connect($name, (sfRoute) $route)
Adds a new route at the end of the current list of routes.
-
findRoute($url)
Finds a matching route for given URL.
-
flattenRoutes($routes)
-
generate($name, $params = array(), $absolute = false)
-
getCurrentInternalUri($withRouteName = false)
-
string
getCurrentRouteName()
Gets the current route name.
-
getRoutes()
-
getRouteThatMatchesParameters($parameters)
-
getRouteThatMatchesUrl($url)
-
boolean
hasRouteName($name)
Returns true if the route name given is defined.
-
hasRoutes()
-
initialize($dispatcher, $cache = null, $options = array())
Initializes this Routing.
-
insertRouteBefore($pivot, $name, $route)
Adds a new route before a given one in the current list of routes.
-
loadConfiguration()
-
loadRoute($name)
Load a lazy route from cache
-
loadRoutes()
Load all lazy routes
-
normalizeUrl($url)
-
parse($url)
-
prependRoute($name, $route)
Adds a new route at the beginning of the current list of routes.
-
setRoutes($routes)
-
shutdown()
-
updateCurrentInternalUri($name, $parameters)
Methods inherited from sfRouting
clearRoutes , filterParametersEvent , fixGeneratedUrl , generate , getCache , getCurrentInternalUri , getDefaultParameter , getDefaultParameters , getOptions , getRoutes , hasRoutes , initialize , listenToChangeCultureEvent , loadConfiguration , mergeArrays , parse , setDefaultParameter , setDefaultParameters , setRoutes , shutdown , __construct
Method Details
-
appendRoute ($name, $route)
Browse code
Adds a new route.
Alias for the connect method.
-
-
configureRoute ($route)
Browse code
-
(array) connect ($name, (sfRoute) $route)
Browse code
| $name |
The route name
|
| $route |
A sfRoute instance
|
Adds a new route at the end of the current list of routes.
A route string is a string with 2 special constructions:
Here is a very common rule in a symfony project: $r->connect('default', new sfRoute('/:module/:action/*'));
returns current routes
-
Finds a matching route for given URL.
Returns false if no route matches. Returned array contains:
name: name or alias of the route that matched pattern: the compiled pattern of the route that matched parameters: array containing key value pairs of the request parameters including defaults
returns An array with routing information or false if no route matched
-
flattenRoutes ($routes)
Browse code
-
generate ($name, $params = array(), $absolute = false)
Browse code
-
getCurrentInternalUri ($withRouteName = false)
Browse code
-
(string) getCurrentRouteName ()
Browse code
Gets the current route name.
returns The route name
-
-
getRouteThatMatchesParameters ($parameters)
Browse code
-
getRouteThatMatchesUrl ($url)
Browse code
-
(boolean) hasRouteName ($name)
Browse code
Returns true if the route name given is defined.
-
-
initialize ($dispatcher, $cache = null, $options = array())
Browse code
| $dispatcher |
|
| $cache |
|
| $options |
|
Initializes this Routing.
Available options: * suffix: The default suffix
* variable_prefixes: An array of characters that starts a variable name (: by default)
* segment_separators: An array of allowed characters for segment separators (/ and . by default)
* variable_regex: A regex that match a valid variable name ([\w\d_]+ by default)
* generate_shortest_url: Whether to generate the shortest URL possible (true by default)
* extra_parameters_as_query_string: Whether to generate extra parameters as a query string
* lazy_routes_deserialize: Use lazy route deserialization optimization: not all routes are deserialized upfront but on demand (false by default)
* lookup_cache_dedicated_keys: Whether to use dedicated keys for parse/generate cache (false by default) WARNING: When this option is activated, do not use sfFileCache; use a fast access cache backend (like sfAPCCache).
-
insertRouteBefore ($pivot, $name, $route)
Browse code
Adds a new route before a given one in the current list of routes.
-
-
| $name |
The name of the route
|
Load a lazy route from cache
returns The route instance unserialized from the cache
-
Load all lazy routes
-
-
-
prependRoute ($name, $route)
Browse code
Adds a new route at the beginning of the current list of routes.
-
-
-
updateCurrentInternalUri ($name, $parameters)
Browse code
|