diff --git a/routing/hostname_pattern.rst b/routing/hostname_pattern.rst index a647c2549b0..8866d507b43 100644 --- a/routing/hostname_pattern.rst +++ b/routing/hostname_pattern.rst @@ -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;