Merge pull request #6 from Tobion/hostname-routes
fix API of RouteCollection
This commit is contained in:
commit
17f51a1873
@ -212,7 +212,9 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
|||||||
// necessarily already have it applied (depending on the order RouteCollections are added to each other)
|
// necessarily already have it applied (depending on the order RouteCollections are added to each other)
|
||||||
$collection->addPrefix($this->getPrefix() . $prefix, $defaults, $requirements, $options);
|
$collection->addPrefix($this->getPrefix() . $prefix, $defaults, $requirements, $options);
|
||||||
|
|
||||||
$collection->setHostnamePattern($hostnamePattern);
|
if ('' !== $hostnamePattern) {
|
||||||
|
$collection->setHostnamePattern($hostnamePattern);
|
||||||
|
}
|
||||||
|
|
||||||
$this->routes[] = $collection;
|
$this->routes[] = $collection;
|
||||||
}
|
}
|
||||||
@ -284,10 +286,6 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
|||||||
{
|
{
|
||||||
$this->hostnamePattern = (string) $pattern;
|
$this->hostnamePattern = (string) $pattern;
|
||||||
|
|
||||||
if ('' === $pattern) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($this->routes as $name => $route) {
|
foreach ($this->routes as $name => $route) {
|
||||||
$route->setHostnamePattern($pattern);
|
$route->setHostnamePattern($pattern);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user