Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ezpMvcRailsRoute Class Reference
Inheritance diagram for ezpMvcRailsRoute:

## Public Member Functions
| __construct ( $pattern, $controllerClassName, $protocolActionMap, array $defaultValues=array(), $protocol=null)
| matches (ezcMvcRequest $request)

## Protected Member Functions
| getSupportedHTTPMethods ()

## Protected Attributes
| $protocolActionMap = array()

## Detailed Description

Definition at line 11 of file rails.php.

## Constructor & Destructor Documentation

## ◆ __construct()

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';

Definition at line 49 of file rails.php.

References $protocolActionMap.

## Member Function Documentation

## ◆ getSupportedHTTPMethods()

ezpMvcRailsRoute::getSupportedHTTPMethods | ( |  | ) |
| protected

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

Returns
  array(string)

Definition at line 104 of file rails.php.

Referenced by matches().

## ◆ matches()

ezpMvcRailsRoute::matches | ( | ezcMvcRequest | $request | ) |

Evaluates the URI against this route and allowed protocols.

Parameters

  ezcMvcRequest | $request |

Returns
  ezcMvcRoutingInformation|null

Exceptions

  ezpRouteMethodNotAllowedException | if a route is found but a wrong HTTP verb is used

Definition at line 79 of file rails.php.

References getSupportedHTTPMethods().

## Member Data Documentation

## ◆ $protocolActionMap

ezpMvcRailsRoute::$protocolActionMap = array()
| protected

Definition at line 18 of file rails.php.

Referenced by __construct().

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

- rails.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.