July 2017
Intermediate to advanced
456 pages
11h 32m
English
A plugin manager is a service that defines how a plugin is discovered and annotated. Let's look at how the block plugin manager is set up. First, the service for it is defined, like other core services, in the core.services.yml file. You see:
plugin.manager.block: class: Drupal\Core\Block\BlockManager parent: default_plugin_manager
This declares the service by a unique name, plugin.manager.block, and defines the class name and the parent service, in this case default_plugin_manager, which was defined earlier as being the DefaultPluginManager class. Most of the work of the plugin manager is done inside the constructor. Looking at the BlockManager::__construct function, we have:
public function __construct(\Traversable ...
Read now
Unlock full access