Closed yceruto closed 8 years ago
Customizing the Dynamic Router > Using a Custom Route Provider > Creating the Route Provider > getRouteByName method link:
/** * This method is used to generate URLs, e.g. {{ path('foobar') }}. */ public function getRouteByName($name, $params = array()) { $document = $this->findOneBy(array( 'name' => $name, )); // <--- missing RouteNotFoundException if $document is null if ($route) { // <--- undefined variable $route $route = new SymfonyRoute($route->getPattern(), array( // <--- undefined variable $route 'document' => $document, )); } return $route; }
seems we did not check good enough what we whre explaining here. thanks for fixing these mistakes!
Customizing the Dynamic Router > Using a Custom Route Provider > Creating the Route Provider > getRouteByName method link: