function ConfigureBlockFormBase::getPluginForm

Same name in other branches
  1. 9 core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php \Drupal\layout_builder\Form\ConfigureBlockFormBase::getPluginForm()
  2. 10 core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php \Drupal\layout_builder\Form\ConfigureBlockFormBase::getPluginForm()
  3. 11.x core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php \Drupal\layout_builder\Form\ConfigureBlockFormBase::getPluginForm()

Retrieves the plugin form for a given block.

Parameters

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

Return value

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

File

core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php, line 254

Class

ConfigureBlockFormBase
Provides a base form for configuring a block.

Namespace

Drupal\layout_builder\Form

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.