1
0
mirror of https://github.com/dannyvankooten/AltoRouter.git synced 2025-08-09 01:46:34 +02:00

Fixed issue with optional params

added tests
This commit is contained in:
Koen Punt
2013-07-14 23:22:59 +02:00
parent a0ecc77b0c
commit 77dba7b120
3 changed files with 277 additions and 4 deletions

View File

@@ -2,9 +2,9 @@
class AltoRouter {
private $routes = array();
private $namedRoutes = array();
private $basePath = '';
protected $routes = array();
protected $namedRoutes = array();
protected $basePath = '';
/**
* Set the base path.
@@ -73,7 +73,7 @@ class AltoRouter {
if(isset($params[$param])) {
$url = str_replace($block, $params[$param], $url);
} elseif ($optional) {
$url = str_replace($block, '', $url);
$url = str_replace($pre . $block, '', $url);
}
}