Skip to content

Improve routing debug page #8313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions routing/debug.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ your application:

.. code-block:: text

homepage ANY /
contact GET /contact
contact_process POST /contact
article_show ANY /articles/{_locale}/{year}/{title}.{_format}
blog ANY /blog/{page}
blog_show ANY /blog/{slug}
------------------ -------- -------- ------ ----------------------------------------------
Name Method Scheme Host Path
------------------ -------- -------- ------ ----------------------------------------------
homepage ANY ANY ANY /
contact GET ANY ANY /contact
contact_process POST ANY ANY /contact
article_show ANY ANY ANY /articles/{_locale}/{year}/{title}.{_format}
blog ANY ANY ANY /blog/{page}
blog_show ANY ANY ANY /blog/{slug}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be all indented with 4 spaces, in order for it to be included in the code block defined on line 22.


You can also get very specific information on a single route by including
the route name after the command:
Expand All @@ -47,3 +50,19 @@ This command will print which route the URL matches.
.. code-block:: text

Route "blog_show" matches

If you want to list the controller configured with each route, you can use the ``--show-controllers`` option:

.. code-block:: terminal

$ php app/console debug:router --show-controllers

This command will print a list of *all* the configured routes in your application
with a new column *Controller* which shows the controller configred for a specific route:

.. code-block:: text

--------------- -------- -------- ------ -------------- ---------------------
Name Method Scheme Host Path Controller
--------------- -------- -------- ------ -------------- ---------------------
blog_show ANY ANY ANY /blog/{slug} AppBundle:Blog:show