etten/symfony-events

Symfony Events for Nette Framework

Maintainers

Details

gitlab.com/etten/symfony-events

Installs: 13 023

Dependents: 1

Suggesters: 0

Stars: 0

Watchers: 1

Forks: 0

v1.1.0 2016-07-18 12:35 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