etten/symfony-events

Symfony Events for Nette Framework

v1.1.0 2016-07-18 12:35 UTC

This package is auto-updated.

Last update: 2024-10-10 08:09:24 UTC


README

This adds EventDispatcher Component support into your Nette Framework project.

It's an extension of Kdyby\Events.

Installation

Best way is installation via Composer.

$ composer require kdyby/events $ composer require etten/symfony-events

Then open your app/config/config.neon file and register following extensions:


extensions:
	kdyby.events: Kdyby\Events\DI\EventsExtension
	symfony.events: Etten\SymfonyEvents\EventsExtension

It's all!

Register EventSubscriberInterface implementor

You have two options. Just open your config file, eg. app/config/config.neon.

a. Tagged service


service:
	monolog.symfony.console.handler:
	class: Symfony\Bridge\Monolog\Handler\ConsoleHandler
	tags: [symfony.subscriber] # this is a magic line

b. Extension section


symfony.events:
	subscribers:
		- Symfony\Bridge\Monolog\Handler\ConsoleHandler