Skip to content

Commit 71dd533

Browse files
krlovexabbuh
authored andcommitted
Update hostname_pattern.rst
`Symfony\Component\Routing\RouteCollection::addCollection` accepts one argument on type `RouteCollection` that is why `$collection->addCollection($loader->import("@AcmeHelloBundle/Resources/config/routing.php"), '', array(), array(), array(), 'hello.example.com');` is not correct.
1 parent 99247f7 commit 71dd533

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

routing/hostname_pattern.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,11 @@ You can also set the host option on imported routes:
262262
263263
use Symfony\Component\Routing\RouteCollection;
264264
265+
$importedCollection = $loader->import("@AcmeHelloBundle/Resources/config/routing.php");
266+
$importedCollection->setHost('hello.example.com');
267+
265268
$collection = new RouteCollection();
266-
$collection->addCollection($loader->import("@AcmeHelloBundle/Resources/config/routing.php"), '', array(), array(), array(), 'hello.example.com');
269+
$collection->addCollection($importedCollection);
267270
268271
return $collection;
269272

0 commit comments

Comments
 (0)