Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8a1afae

Browse filesBrowse files
committed
Moved tip block to remove confusion
1 parent 9c30509 commit 8a1afae
Copy full SHA for 8a1afae

File tree

Expand file treeCollapse file tree

1 file changed

+10
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-6
lines changed

‎components/routing/hostname_pattern.rst

Copy file name to clipboardExpand all lines: components/routing/hostname_pattern.rst
+10-6Lines changed: 10 additions & 6 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.