Creating a Package Plugin

Last updated on
11 April 2017

Packages are plugins that implement the PackageBase class. They should reside in your module's /src/Plugin/Package directory. No functions are required - just the plugin annotation which is explained in the Package annotation class.

If your Package is configurable by the user, you should implement the three form functions found in the PackageBase class, set your configurable annotation to TRUE, and provide the default settings values in the default_settings annotation. This will expose a Settings link next to your package if the user has enabled it.

Your Package can access the user's settings via $this->getSettings() from within any function or they can be accessed via the service.

There are also example modules which can serve as a guide for creating your own Packages.

Help improve this page

Page status: No known problems

You can: