public function Blocks::addBlock in Context 8.4
Same name and namespace in other branches
- 8 src/Plugin/ContextReaction/Blocks.php \Drupal\context\Plugin\ContextReaction\Blocks::addBlock()
- 8.0 src/Plugin/ContextReaction/Blocks.php \Drupal\context\Plugin\ContextReaction\Blocks::addBlock()
Add a new block.
Parameters
array $configuration: The configuration from the block.
Return value
string The uuid from the block.
File
- src/
Plugin/ ContextReaction/ Blocks.php, line 464
Class
- Blocks
- Provides a content reaction.
Namespace
Drupal\context\Plugin\ContextReactionCode
public function addBlock(array $configuration) {
$configuration['uuid'] = $this->uuid
->generate();
$this
->getBlocks()
->addInstanceId($configuration['uuid'], $configuration);
return $configuration['uuid'];
}