Video Lesson: Create and dispatch an event in Magento

Create and dispatch an event in Magento

This is premium content

Only available to enrolled or University students.
Join today to unlock all lessons in this course.

Create and dispatch an event in Magento

Learn how to create and dispatch a custom event in Magento using ManagerInterface and request data.

Lesson Content

It’s very simple to dispatch an event in Magento. When would you want to do this?

Events are broadcast any time you’d like an action carried out that isn’t dependent upon a response. For example, you might send out an event when a specific page is viewed, similar to something like Google Analytics. You’re basically saying “here’s an event, and it’s up to you to do as you see fit.”

Go to the blog post detail class, and create a new private property that is of type ManagerInterface from Magento\Framework\Event. Sometimes if a class name is so generic, such as this one named Manager...

Premium content

Enroll to unlock the full content and all course materials.

Maggie

Hey, I'm Maggie! 👋

Ask me anything.

Want to chat with Maggie?

Enroll in this course for AI tutor access.

Comments

Join the discussion!

Comments

Want to comment on this lesson?

Enroll in this course to leave comments.