You are here

public function LazyRouteCollection::get in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony-cmf/routing/LazyRouteCollection.php \Symfony\Cmf\Component\Routing\LazyRouteCollection::get()

Gets a route by name.

Parameters

string $name The route name:

Return value

Route|null A Route instance or null when not found

Overrides RouteCollection::get

File

vendor/symfony-cmf/routing/LazyRouteCollection.php, line 67

Class

LazyRouteCollection

Namespace

Symfony\Cmf\Component\Routing

Code

public function get($name) {
  try {
    return $this->provider
      ->getRouteByName($name);
  } catch (RouteNotFoundException $e) {
    return null;
  }
}