Back to Router class

Method processParseRules

protected void
processParseRules
(mixed &$uri, mixed $stage = self::PROCESS_DURING)
Process the parsed router variables based on custom defined rules
Parameters
  • \Joomla\CMS\Uri\Uri & $uri The URI to parse
  • string $stage The stage that should be processed. Possible values: 'preprocess', 'postprocess' and '' for the main parse stage
Returns
  • void
Since
  • 3.2
Class: Router
Project: Joomla

Method processParseRules - Source code

/**
 * Process the parsed router variables based on custom defined rules
 *
 * @param   \Joomla\CMS\Uri\Uri  &$uri   The URI to parse
 * @param   string               $stage  The stage that should be processed.
 *                                       Possible values: 'preprocess', 'postprocess'
 *                                       and '' for the main parse stage
 *
 * @return  void
 *
 * @since   3.2
 */
protected function processParseRules(&$uri, $stage = self::PROCESS_DURING)
{
    if (!\array_key_exists('parse' . $stage, $this->rules)) {
        throw new \InvalidArgumentException(sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__));
    }
    foreach ($this->rules['parse' . $stage] as $rule) {
        $rule($this, $uri);
    }
}