addRule()
getRouteMatch()
getRoutePath()
getRules()
getSubComponentAction()
match()
resetRules()
resolveActionAsPageNumber()
resolveActionWithIntegerOrStringParam()
resolveActionWithIntegerParam()
resolveActionWithStringParam()
$_defaultResponseType
$_routePathIfEmpty
$_rules
Class that resolves a path in the URI or other part of the request to a controller/action.
Also allows the type of response that is desired to be controlled based on input. Individual matches can make modifications to the routing path to be passed to other rules.
Rules will continue matching until a XenForo_RouteMatch object is returned that has a controller name specified.
package | XenForo_Mvc |
---|
addRule(\XenForo_Route_Interface $route, string $name) : \XenForo_Router
string
Name of the rule. If it already exists, it is overwritten.
\XenForo_Router
Fluent interface ($this)getRouteMatch(string $controllerName, string | false $action, string $majorSection, string $minorSection) : \XenForo_RouteMatch
string
string
false
string
string
getRoutePath(\Zend_Controller_Request_Http $request) : string
\Zend_Controller_Request_Http
Request object
string
Routing pathgetRules() : array
array
getSubComponentAction(array $subComponents, string $routePath, \Zend_Controller_Request_Http $request, string $controllerOverride) : string | false
Note that the prefix has already been removed from this link.
array
string
\Zend_Controller_Request_Http
string
Current controller passed in by referenced; overridden if sub-component chooses
string
false
String of action if sub-component matched; false otherwisematch(\Zend_Controller_Request_Http $request) : \XenForo_RouteMatch | false
If no match can be found, the getNotFoundError() handler is invoked.
\Zend_Controller_Request_Http
Request object
\XenForo_RouteMatch
false
Final information (including controller and action) about where to route toresetRules() : \XenForo_Router
\XenForo_Router
Fluent interface ($this)resolveActionAsPageNumber(string $action, \Zend_Controller_Request_Http $request) : string
string
\Zend_Controller_Request_Http
string
resolveActionWithIntegerOrStringParam(\strign $routePath, \Zend_Controller_Request_Http $request, string $intParamName, string $stringParamName)
Note that
This method is not an ideal function to use when you are not guaranteed to have data.
\strign
\Zend_Controller_Request_Http
string
Name of the parameter to set if int is found
string
Name of the parameter to set if string is found
resolveActionWithIntegerParam(string $routePath, \Zend_Controller_Request_Http $request, string $paramName, string $defaultActionWithParam) : string
Supports name.123/action1/action2 (returns "action1/action2"). If given "action1/action2", this will return the full string as the action as long as action1 does not have a "." in it.
string
Full path to route against. This should not include a prefix.
\Zend_Controller_Request_Http
Request object
string
Name of the parameter to be registered with the request object (if found)
string
If there's no action and there is an int param, use this as the default action
string
The requested actionresolveActionWithStringParam(string $routePath, \Zend_Controller_Request_Http $request, string $paramName) : string
If there are no slashes, then an action is assumed. If there is a slash, then the first item is considered the string param.
For example: list => "list" action. blah/list => "list" action, with "blah" param.
string
Full path to route against. This should not include a prefix.
\Zend_Controller_Request_Http
Request object
string
Name of the parameter to be registered with the request object (if found)
string
The requested action$_defaultResponseType : string
$_routePathIfEmpty : string
$_rules : array
Once a match is found, further matching stops.
see | \global\addRules() |
---|