Skip to content

Commit bc1d579

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: add a warning about object as extra parameter in route
2 parents 3eff826 + 9fcc2b9 commit bc1d579

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

routing.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,6 +2371,14 @@ use the ``generateUrl()`` helper::
23712371
// the 'blog' route only defines the 'page' parameter; the generated URL is:
23722372
// /blog/2?category=Symfony
23732373

2374+
.. caution::
2375+
2376+
While objects are converted to string when used as placeholders, they are not
2377+
converted when used as extra parameters. So, if you're passing an object (e.g. an Uuid)
2378+
as value of an extra parameter, you need to explictly convert it to a string::
2379+
2380+
$this->generateUrl('blog', ['uuid' => (string) $entity->getUuid()]);
2381+
23742382
If your controller does not extend from ``AbstractController``, you'll need to
23752383
:ref:`fetch services in your controller <controller-accessing-services>` and
23762384
follow the instructions of the next section.

0 commit comments

Comments
 (0)