File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -1028,12 +1028,20 @@ a slash. URLs matching this route might look like:
10281028
10291029 This example also highlights the special ``_format `` routing parameter.
10301030 When using this parameter, the matched value becomes the "request format"
1031- of the ``Request `` object. Ultimately, the request format is used for such
1032- things as setting the ``Content-Type `` of the response (e.g. a ``json ``
1033- request format translates into a ``Content-Type `` of ``application/json ``).
1034- It can also be used in the controller to render a different template for
1035- each value of ``_format ``. The ``_format `` parameter is a very powerful way
1036- to render the same content in different formats.
1031+ of the ``Request `` object.
1032+
1033+ Ultimately, the request format is used for such things as setting the
1034+ ``Content-Type `` of the response (e.g. a ``json `` request format translates
1035+ into a ``Content-Type `` of ``application/json ``). It can also be used in the
1036+ controller to render a different template for each value of ``_format ``.
1037+ The ``_format `` parameter is a very powerful way to render the same content
1038+ in different formats.
1039+
1040+ In Symfony versions previous to 3.0, it is possible to override the request
1041+ format by adding a query parameter named ``_format `` (for example:
1042+ ``/foo/bar?_format=json ``). Relying on this behavior not only is considered
1043+ a bad practice but it will complicate the upgrade of your applications to
1044+ Symfony 3.
10371045
10381046.. note ::
10391047
You can’t perform that action at this time.
0 commit comments