protected NullGenerator::getRoute($name)
generate(), generateFromRoute(), and getPathFromRoute() all call this protected method.
Overrides UrlGenerator::getRoute
File
- core/lib/Drupal/Core/Routing/NullGenerator.php, line 33
Class
- NullGenerator
- No-op implementation of a Url Generator, needed for backward compatibility.
Namespace
Drupal\Core\Routing
Code
1 2 3 4 5 6 7 8 9 10 11 12 | protected function getRoute( $name ) { if ( $name === '<front>' ) { return new Route( '/' ); } elseif ( $name === '<current>' ) { return new Route( $this ->requestStack->getCurrentRequest()->getPathInfo()); } elseif ( $name === '<none>' ) { return new Route( '' ); } throw new RouteNotFoundException(); } |
Please login to continue.