PluginFormFactoryInterface.php

Same filename and directory in other branches
  1. 9 core/lib/Drupal/Core/Plugin/PluginFormFactoryInterface.php
  2. 8.9.x core/lib/Drupal/Core/Plugin/PluginFormFactoryInterface.php
  3. 10 core/lib/Drupal/Core/Plugin/PluginFormFactoryInterface.php

Namespace

Drupal\Core\Plugin

File

core/lib/Drupal/Core/Plugin/PluginFormFactoryInterface.php

View source
<?php

namespace Drupal\Core\Plugin;


/**
 * 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.
 */
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);

}

Interfaces

Title Deprecated Summary
PluginFormFactoryInterface Provides an interface for retrieving form objects for plugins.

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