eZ Publish Community Project (Legacy Stack) 2013.4
Class

ezpMvcRegexpRoute

class ezpMvcRegexpRoute extends ezcMvcRegexpRoute

Override of ezcMvcRegexpRoute.

Necessary to be able to be mixed with rails-like routes

Methods

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

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

prefix($prefix)

Little fix to allow mixed regexp and rails routes in the router

null|ezcMvcRoutingInformation matches(ezcMvcRequest $request)

Evaluates the URI against this route and allowed protocols

Details

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

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

Examples: $route = new ezpMvcRegexpRoute( REGEXP, 'ezpRestContentController' array( 'http-get' => 'viewContent', 'http-delete' => 'deleteContent' ) );

will define the route with the REGEXP 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 (kept to not introduce a BC break)

Parameters

string $pattern
string $controllerClassName
array|string $protocolActionMap
array $defaultValues

at line 68
public prefix($prefix)

Little fix to allow mixed regexp and rails routes in the router

Parameters

$prefix

See also

lib/ezc/MvcTools/src/routes/ezcMvcRegexpRoute::prefix()

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

Evaluates the URI against this route and allowed protocols

The method first runs the match. If the regular expression matches, it cleans up the variables to only include named parameters. it then creates an object containing routing information and returns it. If the route's pattern did not match it returns null.

Parameters

ezcMvcRequest $request

Return Value

null|ezcMvcRoutingInformation