@@ -801,10 +801,11 @@ Priority Parameter
801
801
802
802
The ``priority `` parameter was introduced in Symfony 5.1
803
803
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.
808
809
809
810
.. code-block :: php-annotations
810
811
@@ -817,25 +818,29 @@ and it is only available when using annotations.
817
818
class BlogController extends AbstractController
818
819
{
819
820
/**
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
+ */
822
825
public function show(string $slug)
823
826
{
824
827
// ...
825
828
}
826
829
827
- // This route could not be matched without defining a higher priority than 0
828
830
/**
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
+ */
831
835
public function list()
832
836
{
833
837
// ...
834
838
}
835
839
}
836
840
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 ``.
839
844
840
845
Parameter Conversion
841
846
~~~~~~~~~~~~~~~~~~~~
0 commit comments