Skip to content

Commit

Permalink
Update hostname_pattern.rst
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
krlove authored and xabbuh committed Apr 8, 2017
1 parent 99247f7 commit 71dd533
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion routing/hostname_pattern.rst
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,11 @@ You can also set the host option on imported routes:
use Symfony\Component\Routing\RouteCollection;
$importedCollection = $loader->import("@AcmeHelloBundle/Resources/config/routing.php");
$importedCollection->setHost('hello.example.com');
$collection = new RouteCollection();
$collection->addCollection($loader->import("@AcmeHelloBundle/Resources/config/routing.php"), '', array(), array(), array(), 'hello.example.com');
$collection->addCollection($importedCollection);
return $collection;
Expand Down

0 comments on commit 71dd533

Please sign in to comment.