Class that represents a result to be returned by a {@link XenForo_Route_Interface}.

package XenForo_Mvc

 Methods

Constructor.

__construct(string $controllerName, string | false $action, string $majorSection, string $minorSection) 

Allows quick set of the controller and action. Other elements should be set directly via the properties.

Parameters

$controllerName

string

If routing to a controller, the controller name to call

$action

stringfalse

If routing to a controller, the action in that controller

$majorSection

string

The major section of the page we're being routed to

$minorSection

string

The minor section of the page we're being routed to

Gets the action.

getAction() : string

Returns

string

Gets the controller name.

getControllerName() : string

Returns

string

Gets the major section that the routing points to.

getMajorSection() : string

Returns

string

Gets the minor section that the routing points to.

getMinorSection() : string

Returns

string

Gets the modified route path.

getModifiedRoutePath() : string | null

If null, no modification is requested.

Returns

stringnull

Gets the response type.

getResponseType() : string

Returns

string

Helper method to set the action.

setAction($action) 

This will automatically translate the action into a a more usable form, by replacing dashes with word breaks. For example, confirm-test will be mapped to ConfirmTest.

Parameters

$action

string

Sets the controller name.

setControllerName(string $controllerName) 

Parameters

$controllerName

string

Sets the modified route path that will be passed to subsequent matches.

setModifiedRoutePath(string | null $routePath) 

Parameters

$routePath

stringnull

Sets the response type.

setResponseType(string $responseType) 

Parameters

$responseType

string

Sets the major and minor sections that we're routing to.

setSections(string $majorSection, string $minorSection) 

This is used to aid navigation.

Parameters

$majorSection

string

$minorSection

string

 Properties

 

If not null, represents a modified version of the routing path to be passed into subsequent rules (if there are any).

$_modifiedRoutePath : null | string

Useful only when the rule generating the object doesn't list a controller and action. Can be set to an empty string to cause the next rule to receive XenForo_Router::$_routePathIfEmpty as the routing path.

 

The name of the action to call in the specified controller class.

$_action : string

Applies only when $controllerName is not empty; must be specified if a controller is specified.

 

The name of the controller class to handle this match.

$_controllerName : string

If not empty, no further rules will be processed and routing will finishe.

 

The major section of the page being routed to.

$_majorSection : string

This is used as a navigation aid; for example, to show the right tab and child sections.

 

The minor section of the page being routed to.

$_minorSection : string

This can, for example, allow the current section within a tab to be displayed as if it's selected.

 

If not empty, the type of response (eg, html, json) that should be returned via the response.

$_responseType : string

If left as an empty string, any previously set type will be used.