Skip to content

Adding info on router:match command #1720

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
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
15 changes: 13 additions & 2 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,17 @@ the route name after the command:

$ php app/console router:debug article_show

.. versionadded:: 2.1
The ``router:match`` command was added in Symfony 2.1

You can check which, if any, route matches a path with the ``router:match``
console command:

.. code-block:: bash

$ php app/console router:match /articles/en/2012/article.rss
Route "article_show" matches

.. index::
single: Routing; Generating URLs

Expand Down Expand Up @@ -1123,9 +1134,9 @@ method:
on server information supplied by PHP. When generating absolute URLs for
scripts run from the command line, you'll need to manually set the desired
host on the ``RequestContext`` object:

.. code-block:: php

$router->getContext()->setHost('www.example.com');

.. index::
Expand Down