- 8.2.x core/core.api.php extending
- 8.0.x core/core.api.php extending
- 8.1.x core/core.api.php extending
- 8.3.x core/core.api.php extending
Overview of extensions and alteration methods for Drupal.
Types of extensions
Drupal's core behavior can be extended and altered via these three basic types of extensions:
- Modules: Modules add to or alter the behavior and functionality of Drupal, by using one or more of the methods listed below. For more information about creating modules, see https://www.drupal.org/developing/modules/8
- Installation profiles: Installation profiles can be used to create distributions, which are complete specific-purpose packages of Drupal including additional modules, themes, and data. For more information, see https://www.drupal.org/developing/distributions.
Alteration methods for modules
Here is a list of the ways that modules can alter or extend Drupal's core behavior, or the behavior of other modules:
- Hooks: Specially-named functions that a module defines, which are discovered and called at specific times, usually to alter behavior or data. See the Hooks topic for more information.
- Plugins: Classes that a module defines, which are discovered and instantiated at specific times to add functionality. See the Plugin API topic for more information.
- Entities: Special plugins that define entity types for storing new types of content or configuration in Drupal. See the Entity API topic for more information.
- Services: Classes that perform basic operations within Drupal, such as accessing the database and sending email. See the Dependency Injection Container and Services topic for more information.
- Routing: Providing or altering "routes", which are URLs that Drupal responds to, or altering routing behavior with event listener classes. See the Routing and menu topic for more information.
- Events: Modules can register as event subscribers; when an event is dispatched, a method is called on each registered subscriber, allowing each one to react. See the Events topic for more information.
Extensions must each be located in a directory whose name matches the short name (or machine name) of the extension, and this directory must contain a file named machine_name.info.yml (where machine_name is the machine name of the extension). See \Drupal\Core\Extension\InfoParserInterface::parse() for documentation of the format of .info.yml files.
core.api.php, line 1262
- Documentation landing page and topics, plus core library hooks.