function RouteBuilder::destruct

Same name in this branch
  1. 9 core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php \Drupal\Core\ProxyClass\Routing\RouteBuilder::destruct()
Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php \Drupal\Core\ProxyClass\Routing\RouteBuilder::destruct()
  2. 8.9.x core/lib/Drupal/Core/Routing/RouteBuilder.php \Drupal\Core\Routing\RouteBuilder::destruct()
  3. 10 core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php \Drupal\Core\ProxyClass\Routing\RouteBuilder::destruct()
  4. 10 core/lib/Drupal/Core/Routing/RouteBuilder.php \Drupal\Core\Routing\RouteBuilder::destruct()
  5. 11.x core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php \Drupal\Core\ProxyClass\Routing\RouteBuilder::destruct()
  6. 11.x core/lib/Drupal/Core/Routing/RouteBuilder.php \Drupal\Core\Routing\RouteBuilder::destruct()

Overrides DestructableInterface::destruct

File

core/lib/Drupal/Core/Routing/RouteBuilder.php, line 218

Class

RouteBuilder
Managing class for rebuilding the router table.

Namespace

Drupal\Core\Routing

Code

public function destruct() {
    // Rebuild routes only once at the end of the request lifecycle to not
    // trigger multiple rebuilds and also make the page more responsive for the
    // user.
    $this->rebuildIfNeeded();
}

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