contributte/event-dispatcher – snadna integrace symfony/event-dispatcher
- Felix
- Nette Core | 1197
contributte/event-dispatcher
Tento balicek spada do rodiny contributte balicku.
- Github: https://github.com/…t-dispatcher
- Web: https://contributte.org/…patcher.html
- Diskuze: http://bit.ly/ctteg
Instalace
composer require contributte/event-dispatcher
Pripadne
composer require contributte/event-dispatcher-extra
Pouziti
Pro detailni pouziti sledujte online dokumentaci.
extensions:
events: Contributte\EventDispatcher\DI\EventDispatcherExtension
events:
autoload: true/false
lazy: true/false
Extra rozsireni
Tento balicek ma svoje extra rozsireni pro Nette, ktere pridava podporu
Application, Template/Latte, Security eventu. Typicky kdyz chces treba navesit
nejaky kod na Application::$onRequest
a dalsi.
use Contributte\EventDispatcher\EventSubscriber;
use Contributte\Events\Extra\Event\Application\RequestEvent;
final class LogRequestSubscriber implements EventSubscriber
{
public static function getSubscribedEvents(): array
{
return [RequestEvent::NAME => 'onLog'];
}
public function onLog(RequestEvent $event): void
{
// Do magic..
}
}
- Github: https://github.com/…atcher-extra
- Web: https://contributte.org/…r-extra.html
- Diskuze: http://bit.ly/ctteg