Routing issue with installation in a sub-directory

ref: https://github.com/symfony/symfony/issues/7129
This commit is contained in:
2manypeople 2013-02-26 13:42:14 -03:00
parent ae5b94fd7c
commit 8d9cd42acd
2 changed files with 11 additions and 1 deletions

View File

@ -94,7 +94,7 @@ class Router extends BaseRouter implements WarmableInterface
foreach ($route->getRequirements() as $name => $value) {
$route->setRequirement($name, $this->resolveString($value));
}
$collection->setPrefix('/'.ltrim($this->resolveString($collection->getPrefix()), '/'));
$route->setPattern($this->resolveString($route->getPattern()));
}
}

View File

@ -259,6 +259,16 @@ class RouteCollection implements \IteratorAggregate, \Countable
return $this->prefix;
}
/**
* Sets the prefix (used to resolve placeholders).
*
* @param string The prefix
*/
public function setPrefix($prefix)
{
$this->prefix = $prefix;
}
/**
* Returns an array of resources loaded to build this collection.
*