3

Some modules are called plugins and majority of the modules I found are called modules. I'm new to Magento 2 and this seems confuses me.

6

In magento2,

Plugin and Module are different.

If you have working on WordPress then, to your point view Magento module is called as Plugin. In Language of WordPress Plugin = Magento module

At magento Plugin is different,

A plugin, or interceptor, is a class that modifies the behavior of public class functions by intercepting a function call and running code before, after, or around that function call. This allows you to substitute or extend the behavior of original, public methods for any class or interface

.

http://devdocs.magento.com/guides/v2.0/extension-dev-guide/plugins.html

| improve this answer | |
0

In just one line as per Magento:

plugin is a class to play with one or more function with out modify function body.

You can add your code before/after/around to that function.

While module is an extension that is a kind of package with features and functionality.

And a module can have one or more plugin class inside in Magento.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.