-
Book Overview & Buying
-
Table Of Contents
Magento 2 Developer's Guide
In this chapter, we will take a look at a feature of Magento called plugins. Before we start with plugins, we first need to understand the term interception because the two terms are used somewhat interchangeably when dealing with Magento.
Interception is a software design pattern that is used when we want to insert code dynamically without necessarily changing the original class behavior. This works by dynamically inserting code between the calling code and the target object.
The interception pattern in Magento is implemented via plugins. They provide the before, after, and around listeners, which help us extend the observed method behavior.
In this chapter, we will cover the following topics:
before listenerafter listeneraround listenerBefore we start creating a plugin, it is worth noting their limitations. Plugins cannot be created for just any class or method, as they do not work for the following...
Change the font size
Change margin width
Change background colour