Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (30 sloc) 1.31 KB
services:
# Name of this service.
my_config_events_subscriber:
# Event subscriber class that will listen for the events.
class: '\Drupal\custom_events\EventSubscriber\ConfigEventsSubscriber'
# Tagged as an event_subscriber to register this subscriber with the event_dispatch service.
tags:
- { name: 'event_subscriber' }
# Subscriber to the event we dispatch in hook_user_login.
custom_events_user_login:
class: '\Drupal\custom_events\EventSubscriber\UserLoginSubscriber'
tags:
- { name: 'event_subscriber' }
another_config_events_subscriber:
class: '\Drupal\custom_events\EventSubscriber\AnotherConfigEventsSubscriber'
tags:
- { name: 'event_subscriber' }
# Subscriber to the event we dispatch in hook_user_login, with dependencies injected.
custom_events_user_login_with_di:
class: '\Drupal\custom_events\EventSubscriber\UserLoginSubscriberWithDI'
arguments: ['@database', '@date.formatter']
tags:
- { name: 'event_subscriber' }
# todo - Requires Drupal 8.5+ for the messenger service
# Subscriber to the config events, with dependencies injected.
# my_config_events_subscriber_with_di:
# class: '\Drupal\custom_events\EventSubscriber\ConfigEventsSubscriberWithDI'
# arguments: ['@messenger']
# tags:
# - { name: 'event_subscriber' }