abstract class PluginFormBase in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Plugin/PluginFormBase.php \Drupal\Core\Plugin\PluginFormBase
- 9 core/lib/Drupal/Core/Plugin/PluginFormBase.php \Drupal\Core\Plugin\PluginFormBase
Provides a base class for plugin forms.
Classes extending this can be in any namespace, but are commonly placed in the 'PluginForm' namespace, such as \Drupal\module_name\PluginForm\ClassName.
Hierarchy
- class \Drupal\Core\Plugin\PluginFormBase implements PluginAwareInterface, PluginFormInterface
Expanded class hierarchy of PluginFormBase
4 files declare their use of PluginFormBase
- EmptyBlockForm.php in core/
modules/ block/ tests/ modules/ block_test/ src/ PluginForm/ EmptyBlockForm.php - SettingsTrayFormAnnotationIsClassBlockForm.php in core/
modules/ settings_tray/ tests/ modules/ settings_tray_test/ src/ Form/ SettingsTrayFormAnnotationIsClassBlockForm.php - SystemBrandingOffCanvasForm.php in core/
modules/ system/ src/ Form/ SystemBrandingOffCanvasForm.php - SystemMenuOffCanvasForm.php in core/
modules/ system/ src/ Form/ SystemMenuOffCanvasForm.php
File
- core/
lib/ Drupal/ Core/ Plugin/ PluginFormBase.php, line 15
Namespace
Drupal\Core\PluginView source
abstract class PluginFormBase implements PluginFormInterface, PluginAwareInterface {
/**
* The plugin this form is for.
*
* @var \Drupal\Component\Plugin\PluginInspectionInterface
*/
protected $plugin;
/**
* {@inheritdoc}
*/
public function setPlugin(PluginInspectionInterface $plugin) {
$this->plugin = $plugin;
}
/**
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
// Validation is optional.
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PluginFormBase:: |
protected | property | The plugin this form is for. | 4 |
PluginFormBase:: |
public | function |
Sets the plugin for this object. Overrides PluginAwareInterface:: |
1 |
PluginFormBase:: |
public | function |
Form validation handler. Overrides PluginFormInterface:: |
2 |
PluginFormInterface:: |
public | function | Form constructor. | 19 |
PluginFormInterface:: |
public | function | Form submission handler. | 17 |