Class

ezpMvcRailsRoute

class ezpMvcRailsRoute extends ezcMvcRailsRoute

File containing ezpMvcRailsRoute class

Methods

__construct(string $pattern, string $controllerClassName, array|string $protocolActionMap, array $defaultValues = array(), null|string $protocol = null)

Constructs a new ezpMvcRailsRoute with $pattern for protocols used as keys in $protocolActionMap

ezcMvcRoutingInformation|null matches(ezcMvcRequest $request)

Evaluates the URI against this route and allowed protocols.

Details

at line 48
public __construct(string $pattern, string $controllerClassName, array|string $protocolActionMap, array $defaultValues = array(), null|string $protocol = null)

Constructs a new ezpMvcRailsRoute with $pattern for protocols used as keys in $protocolActionMap

Examples: $route = new ezpMvcRailsRoute( '/content/node/:nodeId', 'ezpRestContentController' array( 'http-get' => 'viewContent', 'http-delete' => 'deleteContent' ) );

will define the route /content/node/:nodeId and a different method in the controller will be called depending on the used HTTP verb. If $protocolActionMap is a string, we assume the mapping is done for http-get unless another protocol is indicated in deprecated param $protocol (kept to not introduce a BC break)

Parameters

string $pattern
string $controllerClassName
array|string $protocolActionMap
array $defaultValues
null|string $protocol (deprecated) Match specific protocol if $protocolActionMap is a string, eg: 'http-get';

at line 78
public ezcMvcRoutingInformation|null matches(ezcMvcRequest $request)

Evaluates the URI against this route and allowed protocols.

Parameters

ezcMvcRequest $request

Return Value

ezcMvcRoutingInformation|null