function BlockForm::getPluginForm

Same name and namespace in other branches
  1. 8.9.x core/modules/block/src/BlockForm.php \Drupal\block\BlockForm::getPluginForm()
  2. 10 core/modules/block/src/BlockForm.php \Drupal\block\BlockForm::getPluginForm()
  3. 11.x core/modules/block/src/BlockForm.php \Drupal\block\BlockForm::getPluginForm()

Retrieves the plugin form for a given block and operation.

Parameters

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

Return value

\Drupal\Core\Plugin\PluginFormInterface The plugin form for the block.

1 method overrides BlockForm::getPluginForm()
BlockEntitySettingTrayForm::getPluginForm in core/modules/settings_tray/src/Block/BlockEntitySettingTrayForm.php
Retrieves the plugin form for a given block and operation.

File

core/modules/block/src/BlockForm.php, line 436

Class

BlockForm
Provides form for block instance forms.

Namespace

Drupal\block

Code

protected function getPluginForm(BlockPluginInterface $block) {
    if ($block instanceof PluginWithFormsInterface) {
        return $this->pluginFormFactory
            ->createInstance($block, 'configure');
    }
    return $block;
}

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