You are here

protected function ConfigureBlockFormBase::getPluginForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php \Drupal\layout_builder\Form\ConfigureBlockFormBase::getPluginForm()
  2. 9 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.

3 calls to ConfigureBlockFormBase::getPluginForm()
ConfigureBlockFormBase::doBuildForm in core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php
Builds the form for the block.
ConfigureBlockFormBase::submitForm in core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php
Form submission handler.
ConfigureBlockFormBase::validateForm in core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php
Form validation handler.

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;
}