@@ -1006,32 +1006,13 @@ using the request parameters (``slug`` in this case). If no object is found,
10061006Symfony generates a 404 response automatically.
10071007
10081008The ``{slug:post} `` syntax maps the route parameter named ``slug `` to the controller
1009- argument named ``$post ``. It also hints the "param converter" to lookup by slug
1010- when loading the corresponding ``BlogPost `` object from the database.
1009+ argument named ``$post ``. It also hints the "param converter" to look up the
1010+ corresponding ``BlogPost `` object from the database using the slug .
10111011
10121012.. versionadded :: 7.1
10131013
10141014 Route parameter mapping was introduced in Symfony 7.1.
10151015
1016- When more than one entity needs to be derived from route parameters, collisions can happen.
1017- In the following example, the route tries to define two mappings: one to load an author by
1018- name, two to load a category by name. But this is not allowed because from the side of the
1019- route definition, this declares a parameter named "name" twice::
1020-
1021- #[Route('/search-book/{name:author}/{name:category}')]
1022-
1023- Such routes should instead be defined using the following syntax::
1024-
1025- #[Route('/search-book/{authorName:author.name}/{categoryName:category.name}')]
1026-
1027- This way, the route parameter names are unique (``authorName `` and ``categoryName ``) and
1028- the "param converter" can correctly map them to controller arguments (``$author `` and
1029- ``$category ``), loading them both by their name.
1030-
1031- .. versionadded :: 7.3
1032-
1033- This more advanced style of route parameter mapping was introduced in Symfony 7.3.
1034-
10351016More advanced mappings can be achieved using the ``#[MapEntity] `` attribute.
10361017Check out the :ref: `Doctrine param conversion documentation <doctrine-entity-value-resolver >`
10371018to learn how to customize the database queries used to fetch the object from the route
0 commit comments