Views exposed form plugins in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginInterface.php \Drupal\views\Plugin\views\exposed_form\views_exposed_form_plugins
Plugins that handle validation, submission, and rendering of exposed forms.
Exposed forms are used for filters, sorts, and pager settings that are exposed to site visitors. Exposed form plugins handle the rendering, validation, and submission of exposed forms, and may add additional form elements.
To define an Exposed Form Plugin in a module you need to:
- Implement \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginInterface.
- Usually you will want to extend the \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase class.
- Exposed form plugins are annotated with \Drupal\views\Annotation\ViewsExposedForm annotation. See the Annotations topic for more information about annotations.
- They must be in namespace directory Plugin\views\exposed_form.
File
- core/
modules/ views/ src/ Plugin/ views/ exposed_form/ ExposedFormPluginInterface.php, line 8
Classes
Name | Location | Description |
---|---|---|
Basic |
core/ |
Exposed form plugin that provides a basic exposed form. |
ExposedFormPluginBase |
core/ |
Base class for Views exposed filter form plugins. |
InputRequired |
core/ |
Exposed form plugin that provides an exposed form with required input. |
ViewsExposedForm |
core/ |
Defines a Plugin annotation object for views exposed form plugins. |
Interfaces
Name | Location | Description |
---|---|---|
ExposedFormPluginInterface |
core/ |
Interface for exposed filter form plugins. |