lynx-ripe/swix-em-config
Composer 安装命令:
composer require lynx-ripe/swix-em-config
包简介
Swix Event Manager configuration helper module. Allows to attach listeners and aggregates via application config
README 文档
README
Zend Framework 2 module which provides possibility to attach event listeners and aggregates to SharedEventManager via configuration.
Installation
Add this line to your composer require key: "swix/swix-em-config": "dev-master" and update Composer. Then enable SwixEmConfig module in your application config.
Important note
Event listeners can be attached only after loading of all modules (ModuleEvent::EVENT_LOAD_MODULES_POST)
Example
In your application or module config:
<?php use Zend\Mvc\MvcEvent; return [ 'service_manager' => [ 'invokables' => [ 'SomeAggregate' => 'SomeNamespaces\SomeAggregate', 'BootstrapListener' => 'SomeNamespaces\BootstrapListener' ] ], 'event_manager' => [ 'listeners' => [ // This listener will be retrived via ServiceManager ['event' => MvcEvent::EVENT_BOOTSTRAP, 'listener' => 'BootstrapListener'] // This listener will be created directly if its class exists ['event' => 'some_event', 'listener' => SomeNamespaces\WithoutSM\BootstrapListener::class] ], 'aggregates' => [ ['aggregate' => 'SomeAggregate'] ] ] ]
统计信息
- 总下载量: 1.27k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-05-16