Skip to content

Commit 934b021

Browse files
MarieMinasyanweaverryan
authored andcommitted
The host parameter has to be in defaults, not requirements
1 parent 5a3ba1b commit 934b021

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

components/routing/hostname_pattern.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ instance, if you want to match both ``m.example.com`` and
194194
mobile_homepage:
195195
path: /
196196
host: "m.{domain}"
197-
defaults: { _controller: AcmeDemoBundle:Main:mobileHomepage }
198-
requirements:
197+
defaults:
198+
_controller: AcmeDemoBundle:Main:mobileHomepage
199199
domain: "%domain%"
200200
201201
homepage:
@@ -212,7 +212,7 @@ instance, if you want to match both ``m.example.com`` and
212212
213213
<route id="mobile_homepage" path="/" host="m.example.com">
214214
<default key="_controller">AcmeDemoBundle:Main:mobileHomepage</default>
215-
<requirement key="domain">%domain%</requirement>
215+
<default key="domain">%domain%</requirement>
216216
</route>
217217
218218
<route id="homepage" path="/">
@@ -228,8 +228,8 @@ instance, if you want to match both ``m.example.com`` and
228228
$collection = new RouteCollection();
229229
$collection->add('mobile_homepage', new Route('/', array(
230230
'_controller' => 'AcmeDemoBundle:Main:mobileHomepage',
231-
), array(
232231
'domain' => '%domain%',
232+
), array(
233233
), array(), 'm.{domain}'));
234234
235235
$collection->add('homepage', new Route('/', array(

0 commit comments

Comments
 (0)