Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PlaceBlockDeriver.php

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

  • class \Drupal\Component\Plugin\Derivative\DeriverBase implements \Drupal\Component\Plugin\Derivative\DeriverInterface
    • class \Drupal\block\Plugin\ConfigAction\PlaceBlockDeriver extends \Drupal\Component\Plugin\Derivative\DeriverBase

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal