Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

Drupal 8 Plugin API

By editor , 7 July, 2016
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.

 

Tags

  • Drupal 8
  • Code
  • Plugin
Create a simple Block programmatically
Create a new Plugin type using Drupal 8 Plugin API

Comments

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer