Check out our Module Development Guide, we've just added a whole bunch of new tutorials covering Drupal 8's plugin system--as well as a handful of other tutorials useful for anyone developing modules for Drupal 8.
Plugins were added to Drupal 8 as a way to replace some of the features previously provided by hooks. The plugin system allows a particular module or subsystem to provide functionality in an extensible, object-oriented way. And understanding how it works is essential for every module developer. Plugins are used for adding blocks, creating new field types, defining new field formatters, adding row styles to views, defining entity types, and more.
Our set of plugins tutorials covers what plugins are, how to implement new plugins to extend existing subsystems, and how to create new plugin types to make your own code more flexible. We'll also take an in-depth look at how all the components that make up the system work.
This was a fun set of tutorials for me to create. I've both written, and spoken, about the plugin system at length. In my opinion it's one of the fundamental new Drupalisms that every developer needs to understand--as well as an elegant solution to a complex problem. I hope that the content--and quality--of these tutorials reflects that.
Without further ado, get started using Drupal 8's plugin API today:
- What Are Plugins?
- Plugin Types
- Discover Existing Plugin Types
- Implement a Plugin of Any Type
- Plugin Managers
- Plugin Discovery
- Plugin Factories and Mappers
- Plugin Derivatives
- Define a New Plugin Type
- Discover and Use Existing Services
In the process of creating the above tutorials we also added one on Annotations, and one on Drupal Console--two things we felt were essential for anyone working with plugins.
We're working on creating more tutorials covering essential concepts for Drupal 8 module developers including: subscribing to and dispatching events, and implementing hooks--more essential concepts for module developers. We plan to have those ready for publication before the end of the year.
Are there any Drupal 8 module development topics you're itching to learn more about? Let us know.