mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 16:12:14 +00:00
[BUGFIX] Fixed minor errors with optional parameter when using getRoute().
This commit is contained in:
@@ -376,7 +376,11 @@ abstract class RouterEntry {
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user