Plugin Factories and Mappers for Drupal 8, Drupal 9

Last updated March 2, 2021
Module Development8.9.x/9.3.x

Learn how the Plugin API takes a given plugin ID and uses it to instantiate and return a fully configured plugin object. In this tutorial we'll look at:

  • What factories are, and the role they serve in the Plugin API
  • The factories available in core
  • Using mappers to dynamically load a plugin when you don't know the ID of the specific plugin you need.