aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-06-14 16:13:19 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-06-14 16:13:19 +0200
commitbab54bea9188ae37e63e821d23046db68c956c83 (patch)
tree8acc3d3296989830fa47733f8c4ca7d12ce8bd35
parent45a4507c2dc2d4ff536f0c1129ea665b759a41a0 (diff)
downloadRouter-bab54bea9188ae37e63e821d23046db68c956c83.zip
Router-bab54bea9188ae37e63e821d23046db68c956c83.tar.gz
Router-bab54bea9188ae37e63e821d23046db68c956c83.tar.bz2
Automatically set the URI prefix.
-rw-r--r--Http.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/Http.php b/Http.php
index 28246fc..38f9585 100644
--- a/Http.php
+++ b/Http.php
@@ -154,7 +154,11 @@ class Http extends Generic implements \Hoa\Core\Parameter\Parameterizable {
)
);
$this->_parameters->setParameters($parameters);
- $this->setPrefix($this->_parameters->getParameter('prefix'));
+
+ if(null === $prefix = $this->_parameters->getParameter('prefix'))
+ $this->setPrefix(dirname($this->getBootstrap()));
+ else
+ $this->setPrefix($prefix);
foreach($this->_parameters->getParameter('rules.public') as $id => $rule) {