3 namespace Drupal\Core\Plugin;
5 use Drupal\Component\Plugin\PluginAwareInterface;
6 use Drupal\Component\Plugin\PluginInspectionInterface;
7 use Drupal\Core\Form\FormStateInterface;
10 * Provides a base class for plugin forms.
12 * Classes extending this can be in any namespace, but are commonly placed in
13 * the 'PluginForm' namespace, such as \Drupal\module_name\PluginForm\ClassName.
15 abstract class PluginFormBase implements PluginFormInterface, PluginAwareInterface {
18 * The plugin this form is for.
20 * @var \Drupal\Component\Plugin\PluginInspectionInterface
27 public function setPlugin(PluginInspectionInterface $plugin) {
28 $this->plugin = $plugin;
34 public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
35 // Validation is optional.