public function CurrentRouteMatch::resetRouteMatch

public CurrentRouteMatch::resetRouteMatch()

Resets the route match static cache.

The route match should only be statically cached once routing is finished. Any code that uses a route match during routing may be incorrectly assumed to be acting after routing has completed. This method gives that code the ability to fix the static cache.

Overrides ResettableStackedRouteMatchInterface::resetRouteMatch

File

core/lib/Drupal/Core/Routing/CurrentRouteMatch.php, line 119

Class

CurrentRouteMatch
Default object for current_route_match service.

Namespace

Drupal\Core\Routing

Code

public function resetRouteMatch() {
  $this->routeMatches = new \SplObjectStorage();
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Routing!CurrentRouteMatch.php/function/CurrentRouteMatch::resetRouteMatch/8.1.x