Contributte Event-security-bridge
Website 🚀 contributte.org | Contact 👨🏻💻 f3l1x.io | Twitter 🐦 @contributte
# Disclaimer
⚠️ | This project is no longer being maintained. Please use contributte/event-dispatcher-extra (opens new window). |
---|
Composer | contributte/event-security-bridge (opens new window) |
---|---|
Version | |
PHP | |
License |
# Versions
State | Version | Branch | PHP |
---|---|---|---|
stable | ^0.1 | master | >= 5.6 |
# Usage 🎉
extensions:
events: Contributte\EventDispatcher\DI\EventDispatcherExtension
events2security: Contributte\Events\Bridges\Security\DI\EventSecurityBridgeExtension
1
2
3
2
3
# Bridge 🔧
There are several Nette Security events on which you can listen to.
use Contributte\Events\Bridges\Security\Event\LoggedInEvent;
use Contributte\Events\Bridges\Security\Event\LoggedOutEvent;
1
2
2
LoggedInEvent::NAME
&&SecurityEvents::ON_LOGGED_IN
LoggedOutEvent::NAME
&&SecurityEvents::ON_LOGGED_OUT
# Subscriber 💡
use Contributte\EventDispatcher\EventSubscriber;
use Contributte\Events\Bridges\Security\Event\LoggedInEvent;
use Contributte\Events\Bridges\Security\Event\SecurityEvents;
final class LoggedInSubscriber implements EventSubscriber
{
/**
* @return array
*/
public static function getSubscribedEvents()
{
return [SecurityEvents::ON_LOGGED_IN => 'onLoggedIn'];
}
/**
* @param LoggedInEvent $event
* @return void
*/
public function onLoggedIn(LoggedInEvent $event)
{
// do magic
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Development
This package was maintain by these authors.
Consider to support (opens new window) contributte development team. Also thank you for being used this package.