You are here

protected function ConfigureSectionForm::getPluginForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/Form/ConfigureSectionForm.php \Drupal\layout_builder\Form\ConfigureSectionForm::getPluginForm()
  2. 9 core/modules/layout_builder/src/Form/ConfigureSectionForm.php \Drupal\layout_builder\Form\ConfigureSectionForm::getPluginForm()

Retrieves the plugin form for a given layout.

Parameters

\Drupal\Core\Layout\LayoutInterface $layout: The layout plugin.

Return value

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

3 calls to ConfigureSectionForm::getPluginForm()
ConfigureSectionForm::buildForm in core/modules/layout_builder/src/Form/ConfigureSectionForm.php
Form constructor.
ConfigureSectionForm::submitForm in core/modules/layout_builder/src/Form/ConfigureSectionForm.php
Form submission handler.
ConfigureSectionForm::validateForm in core/modules/layout_builder/src/Form/ConfigureSectionForm.php
Form validation handler.

File

core/modules/layout_builder/src/Form/ConfigureSectionForm.php, line 212

Class

ConfigureSectionForm
Provides a form for configuring a layout section.

Namespace

Drupal\layout_builder\Form

Code

protected function getPluginForm(LayoutInterface $layout) {
  if ($layout instanceof PluginWithFormsInterface) {
    return $this->pluginFormFactory
      ->createInstance($layout, 'configure');
  }
  if ($layout instanceof PluginFormInterface) {
    return $layout;
  }
  throw new \InvalidArgumentException(sprintf('The "%s" layout does not provide a configuration form', $layout
    ->getPluginId()));
}