public function NestedMatcher::addPartialMatcher

Adds a partial matcher to the matching plan.

Partial matchers will be run in the order in which they are added.

Parameters

\Drupal\Core\Routing\PartialMatcherInterface $matcher: A partial matcher.

int $priority: (optional) The priority of the matcher. Higher number matchers will be checked first. Default to 0.

Return value

NestedMatcherInterface The current matcher.

Overrides NestedMatcherInterface::addPartialMatcher

File

drupal/core/lib/Drupal/Core/Routing/NestedMatcher.php, line 67
Definition of Drupal\Core\Routing\NestedMatcher.

Class

NestedMatcher
The nested matcher layers multiple partial matchers together.

Namespace

Drupal\Core\Routing

Code

public function addPartialMatcher(PartialMatcherInterface $matcher, $priority = 0) {
  if (empty($this->matchers[$priority])) {
    $this->matchers[$priority] = array();
  }
  $this->matchers[$priority][] = $matcher;
  $this->sortedMatchers = array();
}