Module Development

Implement a Plugin Using PHP Attributes for Drupal 10, 11

As of Drupal 10.2, most plugin types use PHP attributes for discovery and metadata.

In this tutorial, we'll:

  • Provide a recipe for implementing PHP attribute-based plugins.
  • Demonstrate how to figure out where the code and metadata should live for PHP attribute-based plugins.

By the end of this tutorial you should have a recipe for getting started with implementing PHP attribute-based plugins, and a better understanding of how to figure out the details required to implement a given plugin type.