function CompiledRoute::getNumParts

Same name in other branches
  1. 9 core/lib/Drupal/Core/Routing/CompiledRoute.php \Drupal\Core\Routing\CompiledRoute::getNumParts()
  2. 8.9.x core/lib/Drupal/Core/Routing/CompiledRoute.php \Drupal\Core\Routing\CompiledRoute::getNumParts()
  3. 10 core/lib/Drupal/Core/Routing/CompiledRoute.php \Drupal\Core\Routing\CompiledRoute::getNumParts()

Returns the number of parts in this route's path.

The string "foo/bar/baz" has 3 parts, regardless of how many of them are placeholders.

Return value

int The number of parts in the path.

File

core/lib/Drupal/Core/Routing/CompiledRoute.php, line 96

Class

CompiledRoute
A compiled route contains derived information from a route object.

Namespace

Drupal\Core\Routing

Code

public function getNumParts() {
    return $this->numParts;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.