class Dispatcher extends Component

调度器

Properties

ContainerInterface $container from Component
EventManagerInterface $eventManager from Component

Methods

setContainer(ContainerInterface $container)

设置依赖注入容器

from Component
getContainer()

No description

from Component
setEventManager(EventManagerInterface $eventManager)

设置事件管理器

from Component
mixed
trigger(string|EventInterface $event, mixed $data = null)

触发事件

from Component
__get(string $name)

获取容器本身,或者获取容器中的某个服务

from Component
__construct()

BaseDispatcher constructor.

dispatch()

执行调度

forward(array $forward)

无需 redirect 跳转,而直接调用对应的 Handler->Action

setNamespaceName($namespaceName)

No description

getNamespaceName()

No description

setControllerName($handlerName)

No description

getControllerName()

No description

setActionName($actionName)

No description

getActionName()

No description

setParams(array $params)

No description

getParams()

No description

Details

in Component at line 33
setContainer(ContainerInterface $container)

设置依赖注入容器

Parameters

ContainerInterface $container 容器对象实例

in Component at line 41
ContainerInterface getContainer()

Return Value

ContainerInterface

in Component at line 49
setEventManager(EventManagerInterface $eventManager)

设置事件管理器

Parameters

EventManagerInterface $eventManager

in Component at line 57
EventManagerInterface getEventManager()

Return Value

EventManagerInterface

in Component at line 77
mixed trigger(string|EventInterface $event, mixed $data = null)

触发事件

$this->trigger('application.exception', $data);

$event = new Event('application.boot', $data);
$this->trigger($event);

Parameters

string|EventInterface $event 事件名称或事件对象实例
mixed $data 事件相关数据

Return Value

mixed

in Component at line 88
ContainerInterface|mixed __get(string $name)

获取容器本身,或者获取容器中的某个服务

Parameters

string $name

Return Value

ContainerInterface|mixed

at line 30
__construct()

BaseDispatcher constructor.

at line 38
dispatch()

执行调度

at line 114
forward(array $forward)

无需 redirect 跳转,而直接调用对应的 Handler->Action

Parameters

array $forward { @var string namespace @var string controller @var string task @var string action @var array params }

at line 139
setNamespaceName($namespaceName)

Parameters

$namespaceName

at line 144
getNamespaceName()

at line 149
setControllerName($handlerName)

Parameters

$handlerName

at line 154
getControllerName()

at line 159
setActionName($actionName)

Parameters

$actionName

at line 164
getActionName()

at line 169
setParams(array $params)

Parameters

array $params

at line 174
getParams()