What is a plugin or interceptor in Magento?
Learn Magento plugins and interceptors before after around types and best practices.
Lesson Content
There are a few different ways to modify functions and classes in Magento, and the least-invasive, preferred method is by using a plugin. Plugins are also known as interceptors, and are called “hooks” in other open source frameworks.
There are three different types of plugins: before, after, and around. Which one you use depends on what you want to do or modify.
before plugins are used when you want to modify the values of arguments that are passed into functions.
after plugins are used when you want to modify the response returned from a function.
around plugins are used whe...
Join the discussion!
Comments
Want to comment on this lesson?
Enroll in this course to leave comments.