Advertising sustains the DA. Ads are hidden for members. Join today

Contributed module documentation

Packages - Developer's Guide

Packages provides an easy-to-use framework for developing bundles of functionality which each user can enable, disable, and configure for their own use. For a full overview of the Packages module and instructions for how to install it please see the project page.

This guide is aimed at developers that want to integrate with this module and create their own Packages.

Creating a Package Plugin

Packages are plugins that implement the PackageBase class. They should reside in your module's /src/Plugin/Package directory.

Package States

Package States refer to the state of a given package for a given user

The Packages Service

Packages provides a Packages service which is what should be used to either load Packages or their states.

Routes, Views, and Blocks

Easily control access to routes, views, and blocks.

Caching

Since Package states are different for each user, any functionality or rendered elements should be cached per-user.

Examples

The fastest way to learn how to create and use Packages is to read through the example Packages included in the module.

Guide maintainers

mstef's picture