Componette

Componette

contributte

contributte / event-application-bridge v0.1.1

๐Ÿ’€ [DISCONTINUED] Symfony Event Dispatcher and Nette Application (@nette) bridge. Use contributte/event-dispatcher-extra.

download-cloud-line composer require contributte/event-application-bridge

Website ๐Ÿš€ contributte.org | Contact ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป f3l1x.io | Twitter ๐Ÿฆ @contributte

Disclaimer

โš ๏ธ This project is no longer being maintained. Please use contributte/event-dispatcher-extra.
Composer contributte/event-application-bridge
Version
PHP
License

Versions

State Version Branch PHP
stable ^0.1 master >= 5.6

Documentation

Usage ๐ŸŽ‰

extensions:
	events: Contributte\EventDispatcher\DI\EventDispatcherExtension
	events2application: Contributte\Events\Bridges\Application\DI\EventApplicationBridgeExtension

Bridge ๐Ÿ”ง

There are several Nette Application events on which you can listen to.

use Contributte\Events\Bridges\Application\Event\ApplicationEvents;
use Contributte\Events\Bridges\Application\Event\ErrorEvent;
use Contributte\Events\Bridges\Application\Event\PresenterEvent;
use Contributte\Events\Bridges\Application\Event\RequestEvent;
use Contributte\Events\Bridges\Application\Event\ResponseEvent;
use Contributte\Events\Bridges\Application\Event\ShutdownEvent;
use Contributte\Events\Bridges\Application\Event\StartupEvent;
  • StartupEvent::NAME && ApplicationEvents::ON_STARTUP
  • ShutdownEvent::NAME && ApplicationEvents::ON_SHUTDOWN
  • RequestEvent::NAME && ApplicationEvents::ON_REQUEST
  • PresenterEvent::NAME && ApplicationEvents::ON_PRESENTER
  • ResponseEvent::NAME && ApplicationEvents::ON_RESPONSE
  • ErrorEvent::NAME && ApplicationEvents::ON_ERROR

Subscriber ๐Ÿ’ก

use Contributte\EventDispatcher\EventSubscriber;
use Contributte\Events\Bridges\Application\Event\RequestEvent;

final class LogRequestSubscriber implements EventSubscriber
{

	/**
	 * @return array
	 */
	public static function getSubscribedEvents()
	{
		return [RequestEvent::NAME => 'onLog'];
	}

	/**
	 * @param RequestEvent $event
	 * @return void
	 */
	public function onLog(RequestEvent $event)
	{
		// Do magic..
	}
}

Development

This package was maintain by these authors.


Consider to support contributte development team. Also thank you for being used this package.

  • v0.1.1 v0.1.1

    Bumped! ๐Ÿ—

    Changes:

    • added more tests
    • added own ruleset
    • fix invalid namespace
  • v0.1 v0.1

    Bumped! ๐Ÿ‘Š

bar-chart-fill

Statistics

download-cloud-fill
12015
star-fill
1
bug-fill
0
flashlight-fill
89d
price-tag-2-line

Badges

guide-fill

Dependencies

php (>= 5.6)
nette/di (^2.4.8)
Componette Componette felix@nette.org