/** * Constructs a new ezpMvcRegexpRoute with $pattern for protocols used as * keys in $protocolActionMap * * Examples: * <code> * $route = new ezpMvcRegexpRoute( * REGEXP, * 'ezpRestContentController' * array( * 'http-get' => 'viewContent', * 'http-delete' => 'deleteContent' * ) * ); * </code> * * 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) * * @param string $pattern * @param string $controllerClassName * @param array|string $protocolActionMap * @param array $defaultValues */ public function __construct($pattern, $controllerClassName, $protocolActionMap, array $defaultValues = array()) { if (is_string($protocolActionMap)) { $protocolActionMap = array('http-get' => $protocolActionMap); } if (!isset($protocolActionMap['http-options'])) { $protocolActionMap['http-options'] = 'httpOptions'; } $this->protocolActionMap = $protocolActionMap; parent::__construct($pattern, $controllerClassName, '', $defaultValues); }