Skip to content

Commit

Permalink
merged branch DHorchler/2.1 (PR symfony#7193)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.1 branch.

Discussion
----------

Routing issue with installation in a sub-directory

ref: symfony#7129

Commits
-------

8d9cd42 Routing issue with installation in a sub-directory ref: symfony#7129
  • Loading branch information
fabpot committed Mar 23, 2013
2 parents 78ebba5 + 8d9cd42 commit 8ae7d98
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/Routing/Router.php
Expand Up @@ -94,7 +94,7 @@ private function resolveParameters(RouteCollection $collection)
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()));
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/Symfony/Component/Routing/RouteCollection.php
Expand Up @@ -259,6 +259,16 @@ public function getPrefix()
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.
*
Expand Down

0 comments on commit 8ae7d98

Please sign in to comment.