Skip to content

Commit 30e6b18

Browse files
committed
More fixes
1 parent 78e055a commit 30e6b18

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

routing.rst

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ Use the ``methods`` option to restrict the verbs each route should respond to:
197197
HTML forms only support ``GET`` and ``POST`` methods. If you're calling a
198198
route with a different method from an HTML form, add a hidden field called
199199
``_method`` with the method to use (e.g. ``<input type="hidden" name="_method" value="PUT" />``).
200-
If you use :doc:`Symfony forms </forms>` this is done automatically for you.
200+
If you create your forms with :doc:`Symfony Forms </forms>` this is done
201+
automatically for you.
201202

202203
Debugging Routes
203204
~~~~~~~~~~~~~~~~
@@ -229,15 +230,15 @@ route details:
229230
230231
$ php bin/console debug:router app_lucky_number
231232
232-
+-------------+---------------------------------------------------------+
233-
| Property | Value |
234-
+-------------+---------------------------------------------------------+
235-
| Route Name | app_lucky_number |
236-
| Path | /lucky/number/{max} |
237-
| ... | ... |
238-
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
239-
| | utf8: true |
240-
+-------------+---------------------------------------------------------+
233+
+-------------+---------------------------------------------------------+
234+
| Property | Value |
235+
+-------------+---------------------------------------------------------+
236+
| Route Name | app_lucky_number |
237+
| Path | /lucky/number/{max} |
238+
| ... | ... |
239+
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
240+
| | utf8: true |
241+
+-------------+---------------------------------------------------------+
241242
242243
The other command is called ``router:match`` and it shows which route will match
243244
the given URL. It's useful to find out why some URL is not executing the
@@ -594,8 +595,8 @@ Now, when the user visits ``/blog``, the ``blog_list`` route will match and
594595

595596
.. caution::
596597

597-
You can have more than one optional placeholder (e.g. ``/blog/{slug}/{page}``),
598-
but everything after an optional placeholder must be optional. For example,
598+
You can have more than one optional parameter (e.g. ``/blog/{slug}/{page}``),
599+
but everything after an optional parameter must be optional. For example,
599600
``/{page}/blog`` is a valid path, but ``page`` will always be required
600601
(i.e. ``/blog`` will not match this route).
601602

@@ -675,7 +676,7 @@ parameter:
675676
676677
.. tip::
677678

678-
To give a ``null`` default value to any placeholder, add nothing after the
679+
To give a ``null`` default value to any parameter, add nothing after the
679680
``?`` character (e.g. ``/blog/{page?}``).
680681

681682
.. _routing-expression_parameters:
@@ -763,6 +764,7 @@ where you can use any of these variables created by Symfony:
763764
``context``
764765
An instance of :class:`Symfony\\Component\\Routing\\RequestContext`,
765766
which holds the most fundamental information about the route being matched.
767+
766768
``request``
767769
The :ref:`Symfony Request <component-http-foundation-request>` object that
768770
represents the current request.
@@ -1067,7 +1069,7 @@ A possible solution is to change the parameter requirements to be more permissiv
10671069
10681070
.. note::
10691071

1070-
If the route defines several placeholders and you apply this permissive
1072+
If the route defines several parameter and you apply this permissive
10711073
regular expression to all of them, the results won't be the expected. For
10721074
example, if the route definition is ``/share/{path}/{token}`` and both
10731075
``path`` and ``token`` accept ``/``, then ``path`` will contain its contents
@@ -2034,7 +2036,7 @@ This information can be configured per command too::
20342036
}
20352037

20362038
Checking if a Route Exists
2037-
--------------------------
2039+
~~~~~~~~~~~~~~~~~~~~~~~~~~
20382040

20392041
In highly dynamic applications, it may be necessary to check whether a route
20402042
exists before using it to generate a URL. In those cases, don't use the

0 commit comments

Comments
 (0)