src/Sulu/Bundle/RouteBundle/Routing/RouteProvider.php
private function findRouteByPath($path, $locale)
    {
        $path = '/' . ltrim($path, '/');
        if (!array_key_exists($path, $this->routeCache)) {
            $this->routeCache[$path] = $this->routeRepository->findByPath($path, $locale);
        }

        return $this->routeCache[$path];
    }
private function findRouteByPath($path, $locale)
    {
        $path = '/' . ltrim($path, '/');
        if (!array_key_exists($path, $this->routeCache)) {
            $this->routeCache[$path] = $this->routeRepository->findByPath($path, $locale);
        }

        return $this->routeCache[$path];
    }
private function findRouteByPath ( $ path , $ locale ) { $ path = '/' . ltrim ( $ path , '/' ) ; if ( ! array_key_exists ( $ path , $ this -> routeCache ) ) { $ this -> routeCache [ $ path ] = $ this -> routeRepository -> findByPath ( $ path , $ locale ) ; } return $ this -> routeCache [ $ path ] ; }
Find route and cache it.

@param string $path
@param string $locale

@return SuluRoute
Find route and cache it .