Skip to content

Commit d553d70

Browse files
committed
Improved a routing example to show annotations
1 parent 5242e92 commit d553d70

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

routing/external_resources.rst

+16-2
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)