Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 6f0042a

Browse files
committed
Merge pull request #721 from yceruto/patch-1
[Routing] Fixing 'Creating the Route Provider' example
2 parents 77ce997 + 2ecdd01 commit 6f0042a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

bundles/routing/dynamic_customize.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,15 @@ following class provides a simple solution using an ODM Repository.
9191
$document = $this->findOneBy(array(
9292
'name' => $name,
9393
));
94-
95-
if ($route) {
96-
$route = new SymfonyRoute($route->getPattern(), array(
97-
'document' => $document,
98-
));
94+
95+
if (!$document) {
96+
throw new RouteNotFoundException("No route found for name '$name'");
9997
}
10098
99+
$route = new SymfonyRoute($document->getUrl(), array(
100+
'document' => $document,
101+
));
102+
101103
return $route;
102104
}
103105
}

0 commit comments

Comments
 (0)