interface ExposedFormPluginInterface in Drupal 8
Same name and namespace in other branches
- 9 core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginInterface.php \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginInterface
- 10 core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginInterface.php \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginInterface
Interface for exposed filter form plugins.
Exposed form plugins handle the rendering, validation, and submission of exposed forms, and may add additional form elements. These plugins can also alter the view query. See \Drupal\views\Plugin\views\exposed_form\InputRequired as an example of that functionality.
Hierarchy
- interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Component\Plugin\DerivativeInspectionInterface
- interface \Drupal\views\Plugin\views\ViewsPluginInterface
- interface \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginInterface
- interface \Drupal\views\Plugin\views\ViewsPluginInterface
Expanded class hierarchy of ExposedFormPluginInterface
All classes that implement ExposedFormPluginInterface
See also
\Drupal\views\Annotation\ViewsExposedForm
\Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase
Related topics
1 file declares its use of ExposedFormPluginInterface
- DisplayKernelTest.php in core/
modules/ views/ tests/ src/ Kernel/ Plugin/ DisplayKernelTest.php
File
- core/
modules/ views/ src/ Plugin/ views/ exposed_form/ ExposedFormPluginInterface.php, line 42
Namespace
Drupal\views\Plugin\views\exposed_formView source
interface ExposedFormPluginInterface extends ViewsPluginInterface {
/**
* Renders the exposed form.
*
* This method iterates over each handler configured to expose widgets
* to the end user and attach those widgets to the exposed form.
*
* @param bool $block
* (optional) TRUE if the exposed form is being rendered as part of a
* block; FALSE (default) if not.
*
* @return array
* Form build array. This method returns an empty array if the form is
* being rendered as a block.
*
* @see \Drupal\views\ViewExecutable::build()
*/
public function renderExposedForm($block = FALSE);
/**
* Runs before the view is rendered.
*
* Implement if your exposed form needs to run code before the view is
* rendered.
*
* @param \Drupal\views\ResultRow[] $values
* An array of all ResultRow objects returned from the query.
*
* @see \Drupal\views\ViewExecutable::render()
*/
public function preRender($values);
/**
* Runs after the view has been rendered.
*
* Implement if your exposed form needs to run code after the view is
* rendered.
*
* @param string $output
* The rendered output of the view display.
*
* @see \Drupal\views\ViewExecutable::render()
*/
public function postRender(&$output);
/**
* Runs before the view has been executed.
*
* Implement if your exposed form needs to run code before query execution.
*
* @see \Drupal\views\Plugin\views\display\DisplayPluginBase::preExecute()
*/
public function preExecute();
/**
* Runs after the view has been executed.
*
* Implement if your exposed form needs to run code after query execution.
*/
public function postExecute();
/**
* Alters the exposed form.
*
* The exposed form is built by calling the renderExposedForm() method on
* this class, and then letting each exposed filter and sort handler add
* widgets to the form. After that is finished, this method is called to
* let the class alter the finished form.
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @see \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginInterface::renderExposedForm()
* @see \Drupal\views\Form\ViewsExposedForm::buildForm()
*/
public function exposedFormAlter(&$form, FormStateInterface $form_state);
/**
* Validates the exposed form submission.
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @see \Drupal\views\Form\ViewsExposedForm::validateForm()
*/
public function exposedFormValidate(&$form, FormStateInterface $form_state);
/**
* Submits the exposed form.
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param array $exclude
* Array of keys that will not appear in $view->exposed_raw_input; for
* example, 'form_build_id'.
*
* @see \Drupal\views\Form\ViewsExposedForm::submitForm()
*/
public function exposedFormSubmit(&$form, FormStateInterface $form_state, &$exclude);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DerivativeInspectionInterface:: |
public | function | Gets the base_plugin_id of the plugin instance. | 1 |
DerivativeInspectionInterface:: |
public | function | Gets the derivative_id of the plugin instance. | 1 |
ExposedFormPluginInterface:: |
public | function | Alters the exposed form. | 1 |
ExposedFormPluginInterface:: |
public | function | Submits the exposed form. | 1 |
ExposedFormPluginInterface:: |
public | function | Validates the exposed form submission. | 1 |
ExposedFormPluginInterface:: |
public | function | Runs after the view has been executed. | 1 |
ExposedFormPluginInterface:: |
public | function | Runs after the view has been rendered. | 1 |
ExposedFormPluginInterface:: |
public | function | Runs before the view has been executed. | 1 |
ExposedFormPluginInterface:: |
public | function | Runs before the view is rendered. | 1 |
ExposedFormPluginInterface:: |
public | function | Renders the exposed form. | 1 |
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 4 |
PluginInspectionInterface:: |
public | function | Gets the plugin_id of the plugin instance. | 2 |
ViewsPluginInterface:: |
public | function | Provide a form to edit options for this plugin. | 1 |
ViewsPluginInterface:: |
public static | function | ||
ViewsPluginInterface:: |
public | function | Clears a plugin. | 1 |
ViewsPluginInterface:: |
public | function | Filter out stored options depending on the defined options. | 1 |
ViewsPluginInterface:: |
public | function | Returns an array of available token replacements. | 1 |
ViewsPluginInterface:: |
public | function | Returns the plugin provider. | 1 |
ViewsPluginInterface:: |
public | function | Adds elements for available core tokens to a form. | 1 |
ViewsPluginInterface:: |
public | function | Returns a string with any core tokens replaced. | 1 |
ViewsPluginInterface:: |
public | function | Initialize the plugin. | 1 |
ViewsPluginInterface:: |
public | function | Return the human readable name of the display. | 1 |
ViewsPluginInterface:: |
public static | function | Moves form elements into fieldsets for presentation purposes. | 1 |
ViewsPluginInterface:: |
public static | function | Flattens the structure of form elements. | 1 |
ViewsPluginInterface:: |
public | function | Add anything to the query that we might need to. | 1 |
ViewsPluginInterface:: |
public | function | Handle any special handling on the validate form. | 1 |
ViewsPluginInterface:: |
public | function | Returns the summary of the settings in the display. | 1 |
ViewsPluginInterface:: |
public | function | Provide a full list of possible theme templates used by this style. | 1 |
ViewsPluginInterface:: |
public | function | Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away. | 1 |
ViewsPluginInterface:: |
public | function | Returns the usesOptions property. | 1 |
ViewsPluginInterface:: |
public | function | Validate that the plugin is correct and can be saved. | 1 |
ViewsPluginInterface:: |
public | function | Validate the options form. | 1 |