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
stringName of the rule. If it already exists, it is overwritten.
\XenForo_RouterFluent interface ($this)getRouteMatch(string $controllerName, string | false $action, string $majorSection, string $minorSection) : \XenForo_RouteMatch
string
stringfalse
string
string
getRoutePath(\Zend_Controller_Request_Http $request) : string
\Zend_Controller_Request_HttpRequest object
stringRouting pathgetRules() : array
arraygetSubComponentAction(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
stringCurrent controller passed in by referenced; overridden if sub-component chooses
stringfalseString 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_HttpRequest object
\XenForo_RouteMatchfalseFinal information (including controller and action) about where to route toresetRules() : \XenForo_Router
\XenForo_RouterFluent interface ($this)resolveActionAsPageNumber(string $action, \Zend_Controller_Request_Http $request) : string
string
\Zend_Controller_Request_Http
stringresolveActionWithIntegerOrStringParam(\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
stringName of the parameter to set if int is found
stringName 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.
stringFull path to route against. This should not include a prefix.
\Zend_Controller_Request_HttpRequest object
stringName of the parameter to be registered with the request object (if found)
stringIf there's no action and there is an int param, use this as the default action
stringThe 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.
stringFull path to route against. This should not include a prefix.
\Zend_Controller_Request_HttpRequest object
stringName of the parameter to be registered with the request object (if found)
stringThe requested action$_defaultResponseType : string
$_routePathIfEmpty : string
$_rules : array
Once a match is found, further matching stops.
| see | \addRules() |
|---|