Skip to content
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