mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 14:52:12 +00:00
@@ -376,7 +376,11 @@ abstract class RouterEntry {
|
|||||||
throw new RouterException(sprintf('Method %s does not exist in class %s', $method, $className), 404);
|
throw new RouterException(sprintf('Method %s does not exist in class %s', $method, $className), 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
call_user_func_array(array($class, $method), $this->getParameters());
|
$parameters = array_filter($this->getParameters(), function($var){
|
||||||
|
return !is_null($var);
|
||||||
|
});
|
||||||
|
|
||||||
|
call_user_func_array(array($class, $method), $parameters);
|
||||||
|
|
||||||
return $class;
|
return $class;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,10 +40,18 @@ class RouterRoute extends RouterEntry {
|
|||||||
$parameters = $this->parseParameters($route, $url);
|
$parameters = $this->parseParameters($route, $url);
|
||||||
|
|
||||||
if($parameters !== null) {
|
if($parameters !== null) {
|
||||||
$this->parameters = $parameters;
|
|
||||||
|
if(is_array($this->parameters)) {
|
||||||
|
$this->parameters = array_merge($this->parameters, $parameters);
|
||||||
|
} else {
|
||||||
|
$this->parameters = $parameters;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user