Prepare install application

This commit is contained in:
Dennis Eichhorn 2017-11-29 19:43:04 +01:00
parent 61ca4d2e6a
commit cfb8cad454

View File

@ -106,13 +106,13 @@ class Dispatcher
{
$views = [];
$dispatch = explode(':', $controller);
$this->getController($dispatch[0]);
if (($c = count($dispatch)) === 3) {
/* Handling static functions */
$function = $dispatch[0] . '::' . $dispatch[2];
$views[$controller] = $function(...$data);
} elseif ($c === 2) {
$this->getController($dispatch[0]);
$views[$controller] = $this->controllers[$dispatch[0]]->{$dispatch[1]}(...$data);
} else {
throw new \UnexpectedValueException('Unexpected function.');
@ -200,4 +200,4 @@ class Dispatcher
{
$this->controllers[$name] = $controller;
}
}
}