3 namespace Drupal\Core\Plugin;
6 * Provides an interface for retrieving form objects for plugins.
8 * This allows a plugin to define multiple forms, in addition to the plugin
9 * itself providing a form. All forms, decoupled or self-contained, must
10 * implement \Drupal\Core\Plugin\PluginFormInterface. Decoupled forms can
11 * implement \Drupal\Component\Plugin\PluginAwareInterface in order to gain
12 * access to the plugin.
14 interface PluginFormFactoryInterface {
17 * Creates a new form instance.
19 * @param \Drupal\Core\Plugin\PluginWithFormsInterface $plugin
20 * The plugin the form is for.
21 * @param string $operation
22 * The name of the operation to use, e.g., 'add' or 'edit'.
23 * @param string $fallback_operation
24 * (optional) The name of the fallback operation to use.
26 * @return \Drupal\Core\Plugin\PluginFormInterface
27 * A plugin form instance.
29 * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
31 public function createInstance(PluginWithFormsInterface $plugin, $operation, $fallback_operation = NULL);