Events

in

Drupal 9

  • Were introduced in Drupal 8
     
  • Allows the communication between subsystems and modules in object oriented way.
  • Were introduced in Drupal 8
     
  • Allows the communication between subsystems and modules in object oriented way.

We will learn..

  • What are Events in Drupal?
     
  • Understanding Event Subscriber, Event Dispatcher and Event Context
     
  • Create an example of event firing on configuration save or configuration delete.
  • Creating a custom module in Drupal 9
     
  • Basic Understanding of Services in Drupal

Pre-Requisites

What are Events ?

What are Events ?

Allows components to interact with each other

Allows components to interact with each other

What are Events ?

Allows components to interact with each other

Allows components to interact with each other

Built on Symfony Event Dispatcher Component.

What are Events ?

Allows components to interact with each other

Allows components to interact with each other

Built on Symfony Event Dispatcher Component.

Implements Mediator Design Pattern

Events

Events

Event Subscriber

Events

Event Subscriber

Event Registry

Events

Event Subscriber

Event
Registry

Event
Dispatcher

Events

Event Subscriber

Event Registry

Event Dispatcher

Event
Context

Event Subscriber

Event Subscriber

  • Called as the Event Listeners

Event Subscriber

  • Called as the Event Listeners
  • They React to an event being fired

Event Registry

Where all the Event Subscribers are collected and Sorted

Event Dispatcher

Is the one who triggers or dispatches an event througout the system.

Event Context

Set Of Data that is important to the subscriber of an event.

Events in Drupal 9

By Panshul Khurana

Events in Drupal 9

Understanding and Creating Custom Events in Drupal 9

  • 391