eZPublish  4.7
ezpMvcRegexpRoute Class Reference

Override of ezcMvcRegexpRoute. More...

+ Inheritance diagram for ezpMvcRegexpRoute:
+ Collaboration diagram for ezpMvcRegexpRoute:

Public Member Functions

 __construct ($pattern, $controllerClassName, $protocolActionMap, array $defaultValues=array())
 Constructs a new ezpMvcRegexpRoute with $pattern for protocols used as keys in $protocolActionMap. More...
 
 matches (ezcMvcRequest $request)
 Evaluates the URI against this route and allowed protocols. More...
 
 prefix ($prefix)
 Little fix to allow mixed regexp and rails routes in the router. More...
 

Protected Member Functions

 getSupportedHTTPMethods ()
 Returns an array containing the HTTP methods supported by the route based on $this->protocolActionMap. More...
 

Protected Attributes

 $protocolActionMap = array()
 

Detailed Description

Override of ezcMvcRegexpRoute.

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

Constructor & Destructor Documentation

ezpMvcRegexpRoute::__construct (   $pattern,
  $controllerClassName,
  $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

Member Function Documentation

ezpMvcRegexpRoute::getSupportedHTTPMethods ( )
protected

Returns an array containing the HTTP methods supported by the route based on $this->protocolActionMap.

Returns
array(string)

Referenced by matches().

ezpMvcRegexpRoute::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
Returns
null|ezcMvcRoutingInformation
ezpMvcRegexpRoute::prefix (   $prefix)

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

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

Member Data Documentation

ezpMvcRegexpRoute::$protocolActionMap = array()
protected

Referenced by __construct().


The documentation for this class was generated from the following file: