mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-09 21:48:41 +00:00
Merge branch 'develop' of https://github.com/Karaka-Management/phpOMS into develop
This commit is contained in:
commit
72cbfa19db
|
|
@ -129,8 +129,10 @@ final class Dispatcher implements DispatcherInterface
|
||||||
|
|
||||||
$views[$controller] = $data === null ? $function() : $function(...$data);
|
$views[$controller] = $data === null ? $function() : $function(...$data);
|
||||||
} elseif ($c === 2) {
|
} elseif ($c === 2) {
|
||||||
$this->getController($dispatch[0]);
|
$obj = $this->getController($dispatch[0]);
|
||||||
$views[$controller] = $data === null ? $this->controllers[$dispatch[0]]->{$dispatch[1]}() : $this->controllers[$dispatch[0]]->{$dispatch[1]}(...$data);
|
$views[$controller] = $data === null
|
||||||
|
? $obj->{$dispatch[1]}()
|
||||||
|
: $obj->{$dispatch[1]}(...$data);
|
||||||
} else {
|
} else {
|
||||||
throw new \UnexpectedValueException('Unexpected function.');
|
throw new \UnexpectedValueException('Unexpected function.');
|
||||||
}
|
}
|
||||||
|
|
@ -196,14 +198,14 @@ final class Dispatcher implements DispatcherInterface
|
||||||
/**
|
/**
|
||||||
* Set controller by alias.
|
* Set controller by alias.
|
||||||
*
|
*
|
||||||
* @param ModuleAbstract $controller Controller
|
* @param object $controller Controller
|
||||||
* @param string $name Controller string
|
* @param string $name Controller string
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function set(ModuleAbstract $controller, string $name) : void
|
public function set(object $controller, string $name) : void
|
||||||
{
|
{
|
||||||
$this->controllers[$name] = $controller;
|
$this->controllers[$name] = $controller;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user