class PlaceBlockDeriver

Defines a deriver for the `placeBlock` config action.

This creates two actions: `placeBlockInDefaultTheme`, and `placeBlockInAdminTheme`. They behave identically except for which theme they target.

Hierarchy

Expanded class hierarchy of PlaceBlockDeriver

File

core/modules/block/src/Plugin/ConfigAction/PlaceBlockDeriver.php, line 16

Namespace

Drupal\block\Plugin\ConfigAction
View source
final class PlaceBlockDeriver extends DeriverBase {
    
    /**
     * {@inheritdoc}
     */
    public function getDerivativeDefinitions($base_plugin_definition) {
        $this->derivatives['placeBlockInAdminTheme'] = [
            'which_theme' => 'admin',
        ] + $base_plugin_definition;
        $this->derivatives['placeBlockInDefaultTheme'] = [
            'which_theme' => 'default',
        ] + $base_plugin_definition;
        return parent::getDerivativeDefinitions($base_plugin_definition);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
PlaceBlockDeriver::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.