@@ -18,16 +18,17 @@ inside your routing configuration:
18
18
19
19
.. code-block :: yaml
20
20
21
+ # app/config/routing.yml
21
22
contact :
22
23
path : /{_locale}/contact
23
24
defaults : { _controller: AcmeDemoBundle:Main:contact }
24
25
requirements :
25
- _locale : %acme_demo.locales%
26
+ _locale : " %acme_demo.locales%"
26
27
27
28
.. code-block :: xml
28
29
30
+ <!-- app/config/routing.xml -->
29
31
<?xml version =" 1.0" encoding =" UTF-8" ?>
30
-
31
32
<routes xmlns =" http://symfony.com/schema/routing"
32
33
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
33
34
xsi : schemaLocation =" http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd" >
@@ -40,6 +41,7 @@ inside your routing configuration:
40
41
41
42
.. code-block :: php
42
43
44
+ // app/config/routing.php
43
45
use Symfony\Component\Routing\RouteCollection;
44
46
use Symfony\Component\Routing\Route;
45
47
@@ -82,14 +84,15 @@ path):
82
84
83
85
.. code-block :: yaml
84
86
87
+ # app/config/routing.yml
85
88
some_route :
86
89
path : /%acme_demo.route_prefix%/contact
87
90
defaults : { _controller: AcmeDemoBundle:Main:contact }
88
91
89
92
.. code-block :: xml
90
93
94
+ <!-- app/config/routing.xml -->
91
95
<?xml version =" 1.0" encoding =" UTF-8" ?>
92
-
93
96
<routes xmlns =" http://symfony.com/schema/routing"
94
97
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
95
98
xsi : schemaLocation =" http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd" >
@@ -101,6 +104,7 @@ path):
101
104
102
105
.. code-block :: php
103
106
107
+ // app/config/routing.php
104
108
use Symfony\Component\Routing\RouteCollection;
105
109
use Symfony\Component\Routing\Route;
106
110
@@ -116,7 +120,7 @@ path):
116
120
Just like in normal service container configuration files, if you actually
117
121
need a ``% `` in your route, you can escape the percent sign by doubling
118
122
it, e.g. ``/score-50%% ``, which would resolve to ``/score-50% ``.
119
-
123
+
120
124
However, as the ``% `` characters included in any URL are automatically encoded,
121
125
the resulting URL of this example would be ``/score-50%25 `` (``%25 `` is the
122
126
result of encoding the ``% `` character).
0 commit comments