From d4861d3748ca1e9026b14a1580e6d4737aea4253 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 21 Mar 2017 21:33:48 +0200 Subject: [PATCH] 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. --- routing/hostname_pattern.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routing/hostname_pattern.rst b/routing/hostname_pattern.rst index 4c49199fcaa..9c3499ad20f 100644 --- a/routing/hostname_pattern.rst +++ b/routing/hostname_pattern.rst @@ -260,8 +260,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;