Skip to content

Improved a routing example to show annotations #9241

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
wants to merge 2 commits into from
Closed
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
18 changes: 16 additions & 2 deletions routing/external_resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,29 @@ in that directory are parsed and put into the routing.

return $collection;

Prefixing Imported Routes
~~~~~~~~~~~~~~~~~~~~~~~~~
.. _prefixing-imported-routes:

Prefixing the URLs of Imported Routes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can also choose to provide a "prefix" for the imported routes. For example,
suppose you want to prefix all routes in the AppBundle with ``/site`` (e.g.
``/site/blog/{slug}`` instead of ``/blog/{slug}``):

.. configuration-block::

.. code-block:: php-annotations

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;

/**
* @Route("/site")
*/
class DefaultController
{
// ...
}

.. code-block:: yaml

# app/config/routing.yml
Expand Down