Skip to content

Commit d552e69

Browse files
MarieMinasyanweaverryan
authored andcommitted
Moved tip block to remove confusion
1 parent 934b021 commit d552e69

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

components/routing/hostname_pattern.rst

+10-6
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,17 @@ instance, if you want to match both ``m.example.com`` and
176176
177177
return $collection;
178178
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-
185179
.. sidebar:: Using Service Parameters
186180

187181
You can also use service parameters if you do not want to hardcode the
188182
hostname:
189183

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+
190190
.. configuration-block::
191191

192192
.. code-block:: yaml
@@ -197,6 +197,8 @@ instance, if you want to match both ``m.example.com`` and
197197
defaults:
198198
_controller: AcmeDemoBundle:Main:mobileHomepage
199199
domain: "%domain%"
200+
requirements:
201+
domain: "%domain%"
200202
201203
homepage:
202204
path: /
@@ -213,6 +215,7 @@ instance, if you want to match both ``m.example.com`` and
213215
<route id="mobile_homepage" path="/" host="m.example.com">
214216
<default key="_controller">AcmeDemoBundle:Main:mobileHomepage</default>
215217
<default key="domain">%domain%</requirement>
218+
<requirement key="domain">%domain%</requirement>
216219
</route>
217220
218221
<route id="homepage" path="/">
@@ -230,6 +233,7 @@ instance, if you want to match both ``m.example.com`` and
230233
'_controller' => 'AcmeDemoBundle:Main:mobileHomepage',
231234
'domain' => '%domain%',
232235
), array(
236+
'domain' => '%domain%',
233237
), array(), 'm.{domain}'));
234238
235239
$collection->add('homepage', new Route('/', array(

0 commit comments

Comments
 (0)