public function DynamicRouter::addRouteEnhancer

Add route enhancers to the router to let them generate information on matched routes.

The order of the enhancers is determined by the priority, the higher the value, the earlier the enhancer is run.

Parameters

RouteEnhancerInterface $enhancer:

int $priority:

File

drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/DynamicRouter.php, line 245

Class

DynamicRouter
A flexible router accepting matcher and generator through injection and using the RouteEnhancer concept to generate additional data on the routes.

Namespace

Symfony\Cmf\Component\Routing

Code

public function addRouteEnhancer(RouteEnhancerInterface $enhancer, $priority = 0) {
  if (empty($this->enhancers[$priority])) {
    $this->enhancers[$priority] = array();
  }
  $this->enhancers[$priority][] = $enhancer;
  $this->sortedEnhancers = array();
  return $this;
}