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

Commit 5cac76e

Browse files
committed
Merge pull request #130 from frastel/patch-1
fixed some variable mismatches in dynamic router docu snippets
2 parents 0ee5bf1 + 7e2cbce commit 5cac76e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cookbook/using-a-custom-route-repository.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ following class provides a simple solution using an ODM Repository.
2828
public function findManyByUrl($url)
2929
{
3030
// for simplicity we retrieve one route
31-
$myDocument = $this->findOneBy(array(
31+
$document = $this->findOneBy(array(
3232
'url' => $url,
3333
));
3434
35-
$pattern = $myDocument->getUrl(); // e.g. "/this/is/a/url"
35+
$pattern = $document->getUrl(); // e.g. "/this/is/a/url"
3636
3737
$collection = new RouteCollection();
3838
3939
// create a new Route and set our document as
4040
// a default (so that we can retrieve it from the request)
41-
$route = new SymfonyRoute($ep->getPath(), array(
41+
$route = new SymfonyRoute($pattern, array(
4242
'document' => $document,
4343
));
4444

0 commit comments

Comments
 (0)