Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

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

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

## Protected Member Functions
| getSupportedHTTPMethods ()

## Protected Attributes
| $protocolActionMap = array()

## Detailed Description

Override of ezcMvcRegexpRoute. Necessary to be able to be mixed with rails-like routes

Definition at line 16 of file regexp.php.

## Constructor & Destructor Documentation

## ◆ __construct()

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 |

Definition at line 51 of file regexp.php.

References $protocolActionMap.

## Member Function Documentation

## ◆ getSupportedHTTPMethods()

ezpMvcRegexpRoute::getSupportedHTTPMethods | ( |  | ) |
| protected

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

Returns
  array(string)

Definition at line 122 of file regexp.php.

Referenced by matches().

## ◆ 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

Definition at line 91 of file regexp.php.

References getSupportedHTTPMethods().

## ◆ prefix()

ezpMvcRegexpRoute::prefix | ( |  | $prefix | ) |

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

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

Definition at line 69 of file regexp.php.

## Member Data Documentation

## ◆ $protocolActionMap

ezpMvcRegexpRoute::$protocolActionMap = array()
| protected

Definition at line 23 of file regexp.php.

Referenced by __construct().

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

- regexp.php

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