public function BetterExposedFiltersWidgetBase::submitConfigurationForm in Better Exposed Filters 8.5
Same name and namespace in other branches
- 8.4 src/Plugin/BetterExposedFiltersWidgetBase.php \Drupal\better_exposed_filters\Plugin\BetterExposedFiltersWidgetBase::submitConfigurationForm()
Form submission handler.
Parameters
array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().
Overrides PluginFormInterface::submitConfigurationForm
File
- src/
Plugin/ BetterExposedFiltersWidgetBase.php, line 90
Class
- BetterExposedFiltersWidgetBase
- Base class for Better exposed filters widget plugins.
Namespace
Drupal\better_exposed_filters\PluginCode
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
// Apply submitted form state to configuration.
$values = $form_state
->getValues();
foreach ($values as $key => $value) {
if (array_key_exists($key, $this->configuration)) {
$this->configuration[$key] = $value;
}
else {
// Remove from form state.
unset($values[$key]);
}
}
}