mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-16 10:40:18 +03:00
Added default null parameter value to RouterController and RouterResource
This commit is contained in:
@@ -22,13 +22,11 @@ abstract class LoadableRoute extends RouterEntry implements ILoadableRoute {
|
||||
$this->url = '/' . trim($url, '/') . '/';
|
||||
|
||||
if(preg_match_all('/' . static::PARAMETERS_REGEX_MATCH . '/is', $this->url, $matches)) {
|
||||
|
||||
if (count($matches[1])) {
|
||||
foreach (array_keys($matches[1]) as $key) {
|
||||
foreach ($matches[1] as $key) {
|
||||
$this->parameters[$key] = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -12,7 +12,7 @@ class RouterController extends LoadableRoute implements IControllerRoute {
|
||||
protected $method;
|
||||
|
||||
public function __construct($url, $controller) {
|
||||
$this->url = $url;
|
||||
$this->setUrl($url);
|
||||
$this->controller = $controller;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ class RouterResource extends LoadableRoute implements IControllerRoute {
|
||||
protected $controller;
|
||||
|
||||
public function __construct($url, $controller) {
|
||||
$this->url = $url;
|
||||
$this->setUrl($url);
|
||||
$this->controller = $controller;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user