Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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: #7129

Commits
-------

8d9cd42 Routing issue with installation in a sub-directory ref: #7129
  • Loading branch information...
commit 8ae7d985690fadf181dffc12a91a802cfee60ab5 2 parents 78ebba5 + 8d9cd42
@fabpot fabpot authored
View
2  src/Symfony/Bundle/FrameworkBundle/Routing/Router.php
@@ -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()));
}
}
View
10 src/Symfony/Component/Routing/RouteCollection.php
@@ -260,6 +260,16 @@ public function getPrefix()
}
/**
+ * 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.
*
* @return ResourceInterface[] An array of resources
Please sign in to comment.
Something went wrong with that request. Please try again.