public function TabFormBase::validateForm in Block Tabs 8
Form validation handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormBase::validateForm
File
- src/
Form/ TabFormBase.php, line 109
Class
- TabFormBase
- Provides a base form for tab.
Namespace
Drupal\blocktabs\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
// The tab configuration is stored in the 'data' key in the form,
// pass that through for validation.
$tab_data = (new FormState())
->setValues($form_state
->getValue('data'));
$this->tab
->validateConfigurationForm($form, $tab_data);
// Update the original form values.
$form_state
->setValue('data', $tab_data
->getValues());
}