@@ -6,21 +6,13 @@ How to Visualize And Debug Routes
6
6
7
7
While adding and customizing routes, it's helpful to be able to visualize
8
8
and get detailed information about your routes. A great way to see every
9
- route in your application is via the ``debug:router `` console command. Execute
10
- the command by running the following from the root of your project.
9
+ route in your application is via the ``debug:router `` console command, which
10
+ lists * all * the configured routes in your application:
11
11
12
12
.. code-block :: terminal
13
13
14
14
$ php app/console debug:router
15
15
16
- .. versionadded :: 2.6
17
- Prior to Symfony 2.6, this command was called ``router:debug ``.
18
-
19
- This command will print a helpful list of *all * the configured routes in
20
- your application:
21
-
22
- .. code-block :: text
23
-
24
16
homepage ANY /
25
17
contact GET /contact
26
18
contact_process POST /contact
@@ -29,21 +21,18 @@ your application:
29
21
blog_show ANY /blog/{slug}
30
22
31
23
You can also get very specific information on a single route by including
32
- the route name after the command:
24
+ the route name as the command argument :
33
25
34
26
.. code-block :: terminal
35
27
36
28
$ php app/console debug:router article_show
37
29
38
- Likewise, if you want to test whether a URL matches a given route, you can
39
- use the ``router:match `` console command:
30
+ Likewise, if you want to test whether a URL matches a given route, use the
31
+ ``router:match `` command. This is useful to debug routing issues and find out
32
+ which route is associated with the given URL:
40
33
41
34
.. code-block :: terminal
42
35
43
36
$ php app/console router:match /blog/my-latest-post
44
37
45
- This command will print which route the URL matches.
46
-
47
- .. code-block :: text
48
-
49
38
Route "blog_show" matches
0 commit comments