interface PluginFormFactoryInterface

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Plugin/PluginFormFactoryInterface.php \Drupal\Core\Plugin\PluginFormFactoryInterface
  2. 10 core/lib/Drupal/Core/Plugin/PluginFormFactoryInterface.php \Drupal\Core\Plugin\PluginFormFactoryInterface
  3. 11.x core/lib/Drupal/Core/Plugin/PluginFormFactoryInterface.php \Drupal\Core\Plugin\PluginFormFactoryInterface

Provides an interface for retrieving form objects for plugins.

This allows a plugin to define multiple forms, in addition to the plugin itself providing a form. All forms, decoupled or self-contained, must implement \Drupal\Core\Plugin\PluginFormInterface. Decoupled forms can implement \Drupal\Component\Plugin\PluginAwareInterface in order to gain access to the plugin.

Hierarchy

Expanded class hierarchy of PluginFormFactoryInterface

All classes that implement PluginFormFactoryInterface

9 files declare their use of PluginFormFactoryInterface
BlockForm.php in core/modules/block/src/BlockForm.php
BlockFormTest.php in core/modules/block/tests/src/Unit/BlockFormTest.php
ConfigureBlockFormBase.php in core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php
ConfigureSectionForm.php in core/modules/layout_builder/src/Form/ConfigureSectionForm.php
WorkflowEditForm.php in core/modules/workflows/src/Form/WorkflowEditForm.php

... See full list

File

core/lib/Drupal/Core/Plugin/PluginFormFactoryInterface.php, line 14

Namespace

Drupal\Core\Plugin
View source
interface PluginFormFactoryInterface {
    
    /**
     * Creates a new form instance.
     *
     * @param \Drupal\Core\Plugin\PluginWithFormsInterface $plugin
     *   The plugin the form is for.
     * @param string $operation
     *   The name of the operation to use, e.g., 'add' or 'edit'.
     * @param string $fallback_operation
     *   (optional) The name of the fallback operation to use.
     *
     * @return \Drupal\Core\Plugin\PluginFormInterface
     *   A plugin form instance.
     *
     * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
     */
    public function createInstance(PluginWithFormsInterface $plugin, $operation, $fallback_operation = NULL);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
PluginFormFactoryInterface::createInstance public function Creates a new form instance. 1

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