Skip to content

Improved the routing debug article #8968

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

Merged
merged 1 commit into from
Jan 3, 2018
Merged
Changes from all commits
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
23 changes: 6 additions & 17 deletions routing/debug.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,13 @@ How to Visualize And Debug Routes

While adding and customizing routes, it's helpful to be able to visualize
and get detailed information about your routes. A great way to see every
route in your application is via the ``debug:router`` console command. Execute
the command by running the following from the root of your project.
route in your application is via the ``debug:router`` console command, which
lists *all* the configured routes in your application:

.. code-block:: terminal

$ php app/console debug:router

.. versionadded:: 2.6
Prior to Symfony 2.6, this command was called ``router:debug``.

This command will print a helpful list of *all* the configured routes in
your application:

.. code-block:: text

homepage ANY /
contact GET /contact
contact_process POST /contact
Expand All @@ -29,21 +21,18 @@ your application:
blog_show ANY /blog/{slug}

You can also get very specific information on a single route by including
the route name after the command:
the route name as the command argument:

.. code-block:: terminal

$ php app/console debug:router article_show

Likewise, if you want to test whether a URL matches a given route, you can
use the ``router:match`` console command:
Likewise, if you want to test whether a URL matches a given route, use the
``router:match`` command. This is useful to debug routing issues and find out
which route is associated with the given URL:

.. code-block:: terminal

$ php app/console router:match /blog/my-latest-post

This command will print which route the URL matches.

.. code-block:: text

Route "blog_show" matches