Config Action API
Same name in other branches
- 10 core/lib/Drupal/Core/Config/Action/ConfigActionManager.php \Drupal\Core\Config\Action\config_action_api
Information about the classes and interfaces that make up the Config Action API.
Configuration actions are plugins that manipulate simple configuration or configuration entities. The configuration action plugin manager can apply configuration actions. For example, the API is leveraged by recipes to create roles if they do not exist already and grant permissions to those roles.
To define a configuration action in a module you need to:
- Define a Config Action plugin by creating a new class that implements the \Drupal\Core\Config\Action\ConfigActionPluginInterface, in namespace Plugin\ConfigAction under your module namespace. For more information about creating plugins, see the Plugin API topic.
- Config action plugins use the attributes defined by \Drupal\Core\Config\Action\Attribute\ConfigAction. See the Attributes topic for more information about attributes.
Further information and examples:
- \Drupal\Core\Config\Action\Plugin\ConfigAction\EntityMethod derives configuration actions from config entity methods which have the \Drupal\Core\Config\Action\Attribute\ActionMethod attribute.
- \Drupal\Core\Config\Action\Plugin\ConfigAction\EntityCreate allows you to create configuration entities if they do not exist.
- \Drupal\Core\Config\Action\Plugin\ConfigAction\SimpleConfigUpdate allows you to update simple configuration using a config action.
@internal This API is experimental.
File
-
core/
lib/ Drupal/ Core/ Config/ Action/ ConfigActionManager.php, line 55
Classes
Title Sort descending | File name | Summary |
---|---|---|
ConfigAction | core/ |
Defines a ConfigAction attribute object. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.