/** * Configure the route * * @param array $parameters Parameters */ public function configure(array $parameters) { parent::configure($parameters); // Get the variables $routePattern = $this->_pattern; $variableCount = preg_match_all('/:([a-zA-Z]+)/', $routePattern, $variables); if ($variableCount > 0) { $this->_variableCount = $variableCount; $this->_variables = $variables[1]; } else { $this->_variableCount = 0; $this->_variables = []; } }
/** * Configure the route * * @param array $parameters Parameters */ public function configure(array $parameters) { parent::configure($parameters); if (isset($parameters['map'])) { $map = $parameters['map']; if (is_object($map)) { $array = []; foreach ($map as $item) { $array[] = $item; } $map = $array; } $this->_map = $map; } }