An Overview of the Drupal 8 Plugin System
Goodbye hook_block_info(), hello Block Plugins.
The Drupal 8 plugin system provides a set of guidelines and reusable code components that allow developers to expose pluggable functionality within their code and (as needed) support managing these components through the user interface. Understanding the ins and outs of the plugin system will be critical for anyone developing modules for Drupal 8. Blocks, field types, widgets, and views displays are just some of the places you’ll encounter plugins in D8.
In this presentation Joe will draw on his experience working with Drupal 8 plugins in order to write about and helping document the plugin system, and walk through:
- What are plugins and why, when, where are they used?
- How Drupal discovers plugins.
- Annotations and how they relate to plugins.
- Defining a plugin.
- Using plugin derivatives to allow for many instances of a single plugin.
- Defining new plugin types in your own module.
This presentation will be useful for anyone who will be writing new Drupal 8 modules or porting existing code from Drupal 7 to Drupal 8. It will help developers to better understand where plugins fit in the architecture of a Drupal module, and help to map your Drupal 7 knowledge about info hooks and callback functions to Drupal 8 plugins.