merged branch DHorchler/2.1 (PR #7193)

This PR was merged into the 2.1 branch.

Discussion
----------

Routing issue with installation in a sub-directory

ref: https://github.com/symfony/symfony/issues/7129

Commits
-------

8d9cd42 Routing issue with installation in a sub-directory ref: https://github.com/symfony/symfony/issues/7129
This commit is contained in:
Fabien Potencier 2013-03-23 08:47:35 +01:00
commit 8ae7d98569
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.
*