the drupal 8 plugin system: extensibility for all
TRANSCRIPT
THE DRUPAL 8 PLUGINSYSTEM: EXTENSIBILITY FOR
ALLI am , , and .Xano @BartFeenstra http://mynameisbart.com
WHAT ARE PLUGINS?Swappable extensions that provide logic for a specific (set of) task(s)Uniquely identifiableMetadataMultiple instances can co-exist (reuse)
DRUPAL 7 PLUGINSHook discovery (core and most contributed modules)File-based discovery (ctools)Magic hooks/callbacks/includesSome plugins are classed
SAY WHAT?
DRUPAL 8 PLUGINSAre classed. Always.Should implement interfaces.Consistent API for discovering and instantiating plugins, regardless oftype.
NO MORE DARK MAGIC
JARGON, DO YOU SPEAK IT?
PLUGIN TYPE
PLUGIN (DEFINITION)
PLUGIN DISCOVERY
PLUGIN FACTORY
PLUGIN MANAGER(DISCOVERY + FACTORY + ...)
PLUGIN INSTANCE
PLUGIN CONFIGURATION
RECREATING/CLONINGPLUGIN INSTANCES
Using Plugin type/manager, ID, and configuration throughConfigurablePluginInterface.
DISCOVERY METHODSAnnotated class discovery (mostly different logic)YAML discovery (mostly reused logic)Static discovery (testing)Hook discovery (deprecated)
FORMS
PLUGIN TYPE DISCOVERY
ADMINISTRATIVE OVERVIEW
CONFIGURATION SCHEMASplugin.plugin_configuration.*.*
TYPED PLUGIN DEFINITIONAPI
Now: PluginDefinitionMapperInterface
Future: PluginDefinitionInterface
PLUGIN SELECTORS
FIELDTYPES/WIDGETS/FORMATTER
S
CONCLUSIONEXTENDING DRUPAL HAS NEVER BEEN EASIER.
Review this presentation at .http://slideshare.net/bartfeenstra
Find the Plugin module at .http://drupal.org/project/plugin
I am , , and .Xano @BartFeenstra http://mynameisbart.com
DO YOU HAVE ANY QUESTIONS?
© subsetsum @ Flickr (CC BY-NC-ND 2.0)