Drupal 8 Plugin API | Drupal 8

Drupal 8 Plugin API

Submitted by editor on Thu, 07/07/2016 - 13:51
Question

What is the Plugin API in Drupal 8 ?

 

Plugins are small pieces of functionality that are swappable. Plugins that perform similar functionality are of the same plugin type.

Link : https://www.drupal.org/developing/api/8/plugins

Plugins are much like PHP native interfaces with a little extra: the plugin system can discover every implementation of an interface (the default is magic namespacing), deals with metadata (by default this is provided by annotations) and provides a factory for the plugin classes.

 

Plugin or Service?

Plugin
Plugins implement different behaviors via a common interface.

Service
Services provide the same functionality, and are interchangeable, differing only in their internal implementation.

 

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.