Plugin


The plugin type overview at Administer > Structure > Plugins.

The Plugin module complements Drupal core's plugin system in several ways. Its main aim is to make it easy to expose your custom plugin types to the world, and to let code work with any plugin of any plugin type generically. To facilitate that, and other features, it provides the following:

  • Plugin type discovery through modules' *.plugin_type.yml files. See the handbook for documentation on these files.
  • Extensive support for classed plugin definitions (objects), on top of core's \Drupal\Component\Plugin\Definition\PluginDefinitionInterface.
  • Plugin selectors allow users to select plugins of a particular type and configure them using the plugins' configuration forms. Using these reduces your form handling code from several hundreds of lines to ~5 lines of code. Some plugin forms do not correctly save their configuration. See #2536646: [meta] PluginFormInterface implementations assume they are top-level.
  • Filtered plugin manager decorators to easily filter/limit the plugins a manager can provide. These work with any existing plugin manager, and can be injected into other code easily.
  • A plugin field type that allows instances of any known plugin type to be stored on content entities. Plugin selectors are available as widgets. Basic generic formatters are available.
  • Overviews of known plugin types and plugins at Administer > Structure > Plugins.
  • Plugin configuration schemas. This allows saved plugin configuration to be translated, for instance. Their unified naming schemas allow for easy reusability. See the handbook for documentation on the format.

This project is also an incubator for improvements to Drupal core's plugin system that can be merged into Drupal core in future minor versions.

Integration

The following projects use Plugin and/or expose their plugin types through Plugin:

This module is compatible with PHP 7.

Supporting organizations: 
Original research and development

Plugin项目的Drush安装命令:复制到剪贴板

注:个别模块仍需开启相关子模块。
周安装量: 
764
维护状态: 
积极维护中
开发状态: 
积极开发中

推荐版本下载:

版本下载地址发布日期发布说明翻译下载
8.x-2.5tar.gz (71.67 KB) | zip (181.29 KB)2017年4月8日发布说明简 | 繁 | 更多

开发版本下载:

版本下载地址发布日期发布说明翻译下载
8.x-2.x-devtar.gz (71.68 KB) | zip (181.34 KB)2018年10月14日发布说明简 | 繁 | 更多