You are here

protected function BlockAddForm::prepareBlock in Context 8

Same name and namespace in other branches
  1. 8.4 src/Reaction/Blocks/Form/BlockAddForm.php \Drupal\context\Reaction\Blocks\Form\BlockAddForm::prepareBlock()
  2. 8.0 src/Reaction/Blocks/Form/BlockAddForm.php \Drupal\context\Reaction\Blocks\Form\BlockAddForm::prepareBlock()

Prepares the block plugin based on the block ID.

Parameters

string $block_id: Either a block ID, or the plugin ID used to create a new block.

Return value

\Drupal\Core\Block\BlockPluginInterface The block plugin.

Overrides BlockFormBase::prepareBlock

File

src/Reaction/Blocks/Form/BlockAddForm.php, line 26

Class

BlockAddForm

Namespace

Drupal\context\Reaction\Blocks\Form

Code

protected function prepareBlock($block_id) {
  return $this->blockManager
    ->createInstance($block_id);
}