@@ -949,11 +949,11 @@ A common routing need is to convert the value stored in some parameter (e.g. an
949
949
integer acting as the user ID) into another value (e.g. the object that
950
950
represents the user). This feature is called a "param converter".
951
951
952
- To add support for "param converters" we need SensioFrameworkExtraBundle:
953
-
954
- .. code-block :: terminal
952
+ .. versionadded :: 6.2
955
953
956
- $ composer require sensio/framework-extra-bundle
954
+ Starting from Symfony 6.2, route param conversion is a built-in feature.
955
+ In previous Symfony versions you had to install the package
956
+ ``sensio/framework-extra-bundle `` before using this feature.
957
957
958
958
Now, keep the previous route configuration, but change the arguments of the
959
959
controller action. Instead of ``string $slug ``, add ``BlogPost $post ``::
@@ -984,8 +984,9 @@ this case), the "param converter" makes a database request to find the object
984
984
using the request parameters (``slug `` in this case). If no object is found,
985
985
Symfony generates a 404 response automatically.
986
986
987
- Read the `full param converter documentation `_ to learn about the converters
988
- provided by Symfony and how to configure them.
987
+ Check out the `Doctrine param conversion documentation <doctrine-entity-value-resolver >`_
988
+ to learn about the ``#[MapEntity] `` attribute that can be used to customize the
989
+ database queries used to fetch the object from the route parameter.
989
990
990
991
Special Parameters
991
992
~~~~~~~~~~~~~~~~~~
@@ -2672,5 +2673,4 @@ Learn more about Routing
2672
2673
2673
2674
.. _`PHP regular expressions` : https://www.php.net/manual/en/book.pcre.php
2674
2675
.. _`PCRE Unicode properties` : https://www.php.net/manual/en/regexp.reference.unicode.php
2675
- .. _`full param converter documentation` : https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html
2676
2676
.. _`FOSJsRoutingBundle` : https://github.com/FriendsOfSymfony/FOSJsRoutingBundle
0 commit comments