class DsRegionBlock in Display Suite 8.3
Same name in this branch
- 8.3 modules/ds_extras/src/Plugin/Derivative/DsRegionBlock.php \Drupal\ds_extras\Plugin\Derivative\DsRegionBlock
- 8.3 modules/ds_extras/src/Plugin/Block/DsRegionBlock.php \Drupal\ds_extras\Plugin\Block\DsRegionBlock
Same name and namespace in other branches
- 8.2 modules/ds_extras/src/Plugin/Derivative/DsRegionBlock.php \Drupal\ds_extras\Plugin\Derivative\DsRegionBlock
Provides block region definitions for ds blocks.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\ds_extras\Plugin\Derivative\DsRegionBlock
Expanded class hierarchy of DsRegionBlock
See also
\Drupal\ds_extras\Plugin\block\block\DsRegionBlock
File
- modules/
ds_extras/ src/ Plugin/ Derivative/ DsRegionBlock.php, line 12
Namespace
Drupal\ds_extras\Plugin\DerivativeView source
class DsRegionBlock extends DeriverBase {
/**
* Implements \Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinitions().
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$region_blocks = \Drupal::config('ds_extras.settings')
->get('region_blocks');
if (empty($region_blocks)) {
return $this->derivatives;
}
foreach ($region_blocks as $key => $block) {
$this->derivatives[$key] = $base_plugin_definition;
$this->derivatives[$key]['delta'] = $key;
$this->derivatives[$key]['admin_label'] = $block['title'];
}
return $this->derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
DsRegionBlock:: |
public | function |
Implements \Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinitions(). Overrides DeriverBase:: |