eZPublishCommunityProject(LegacyStack)  2013.6
ezpMvcRailsRoute Class Reference
+ Inheritance diagram for ezpMvcRailsRoute:
+ Collaboration diagram for ezpMvcRailsRoute:

Public Member Functions

 __construct ($pattern, $controllerClassName, $protocolActionMap, array $defaultValues=array(), $protocol=null)
 Constructs a new ezpMvcRailsRoute with $pattern for protocols used as keys in $protocolActionMap. More...
 
 matches (ezcMvcRequest $request)
 Evaluates the URI against this route and allowed protocols. 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()
 

Constructor & Destructor Documentation

ezpMvcRailsRoute::__construct (   $pattern,
  $controllerClassName,
  $protocolActionMap,
array  $defaultValues = array(),
  $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';

Member Function Documentation

ezpMvcRailsRoute::getSupportedHTTPMethods ( )
protected

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

Returns
array(string)

Referenced by matches().

ezpMvcRailsRoute::matches ( ezcMvcRequest  $request)

Evaluates the URI against this route and allowed protocols.

Parameters
ezcMvcRequest$request
Returns
ezcMvcRoutingInformation|null
Exceptions
ezpRouteMethodNotAllowedExceptionif a route is found but a wrong HTTP verb is used

Member Data Documentation

ezpMvcRailsRoute::$protocolActionMap = array()
protected

Referenced by __construct().


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