Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d553d70

Browse filesBrowse files
committed
Improved a routing example to show annotations
1 parent 5242e92 commit d553d70
Copy full SHA for d553d70

File tree

Expand file treeCollapse file tree

1 file changed

+16
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-2
lines changed

‎routing/external_resources.rst

Copy file name to clipboardExpand all lines: routing/external_resources.rst
+16-2Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,29 @@ in that directory are parsed and put into the routing.
9292
9393
return $collection;
9494
95-
Prefixing Imported Routes
96-
~~~~~~~~~~~~~~~~~~~~~~~~~
95+
.. _prefixing-imported-routes:
96+
97+
Prefixing the URLs of Imported Routes
98+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9799

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

102104
.. configuration-block::
103105

106+
.. code-block:: php-annotations
107+
108+
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
109+
110+
/**
111+
* @Route("/site")
112+
*/
113+
class DefaultController
114+
{
115+
// ...
116+
}
117+
104118
.. code-block:: yaml
105119
106120
# app/config/routing.yml

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.