@@ -176,17 +176,17 @@ instance, if you want to match both ``m.example.com`` and
176
176
177
177
return $collection;
178
178
179
- .. tip ::
180
-
181
- Make sure you also include a default option for the ``subdomain ``
182
- placeholder, otherwise you need to include the subdomains value each time
183
- you generate the route.
184
-
185
179
.. sidebar :: Using Service Parameters
186
180
187
181
You can also use service parameters if you do not want to hardcode the
188
182
hostname:
189
183
184
+ .. tip ::
185
+
186
+ Make sure you also include a default option for the ``subdomain ``
187
+ placeholder, otherwise you need to include the subdomains value each time
188
+ you generate the route.
189
+
190
190
.. configuration-block ::
191
191
192
192
.. code-block :: yaml
@@ -197,6 +197,8 @@ instance, if you want to match both ``m.example.com`` and
197
197
defaults :
198
198
_controller : AcmeDemoBundle:Main:mobileHomepage
199
199
domain : " %domain%"
200
+ requirements :
201
+ domain : " %domain%"
200
202
201
203
homepage :
202
204
path : /
@@ -213,6 +215,7 @@ instance, if you want to match both ``m.example.com`` and
213
215
<route id =" mobile_homepage" path =" /" host =" m.example.com" >
214
216
<default key =" _controller" >AcmeDemoBundle:Main:mobileHomepage</default >
215
217
<default key =" domain" >%domain%</requirement >
218
+ <requirement key =" domain" >%domain%</requirement >
216
219
</route >
217
220
218
221
<route id =" homepage" path =" /" >
@@ -230,6 +233,7 @@ instance, if you want to match both ``m.example.com`` and
230
233
'_controller' => 'AcmeDemoBundle:Main:mobileHomepage',
231
234
'domain' => '%domain%',
232
235
), array(
236
+ 'domain' => '%domain%',
233
237
), array(), 'm.{domain}'));
234
238
235
239
$collection->add('homepage', new Route('/', array(
0 commit comments