Skip to content

Commit 904932d

Browse files
committed
minor tweak
1 parent 3ce5cd5 commit 904932d

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

routing.rst

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -801,10 +801,11 @@ Priority Parameter
801801

802802
The ``priority`` parameter was introduced in Symfony 5.1
803803

804-
When defining a greedy pattern that matches many routes, this may be
805-
at the beginning of your routing collection and prevents any route defined after to be matched.
806-
A ``priority`` optional parameter is available in order to let you choose the order of your routes,
807-
and it is only available when using annotations.
804+
When defining a greedy pattern that matches many routes, this may be at the
805+
beginning of your routing collection and prevents any route defined after to be
806+
matched.
807+
A ``priority`` optional parameter is available in order to let you choose the
808+
order of your routes, and it is only available when using annotations.
808809

809810
.. code-block:: php-annotations
810811
@@ -817,25 +818,29 @@ and it is only available when using annotations.
817818
class BlogController extends AbstractController
818819
{
819820
/**
820-
* @Route("/blog/{slug}", name="blog_show")
821-
*/
821+
* This route has a greedy pattern and is defined first.
822+
*
823+
* @Route("/blog/{slug}", name="blog_show")
824+
*/
822825
public function show(string $slug)
823826
{
824827
// ...
825828
}
826829
827-
// This route could not be matched without defining a higher priority than 0
828830
/**
829-
* @Route("/blog/list", name="blog_list", priority=2)
830-
*/
831+
* This route could not be matched without defining a higher priority than 0.
832+
*
833+
* @Route("/blog/list", name="blog_list", priority=2)
834+
*/
831835
public function list()
832836
{
833837
// ...
834838
}
835839
}
836840
837-
The priority parameter expects an integer value. Routes with higher priority are sorted before routes with
838-
lower priority, default value when this parameter in undefined is ``0``.
841+
The priority parameter expects an integer value. Routes with higher priority
842+
are sorted before routes with lower priority. The default value when it is not
843+
defined is ``0``.
839844

840845
Parameter Conversion
841846
~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)