public function ManageSortFieldsForm::validateForm in Search API Sorts Widget 1.x
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/ ManageSortFieldsForm.php, line 337
Class
- ManageSortFieldsForm
- Provides a form for managing sort fields for a search api display.
Namespace
Drupal\search_api_sorts_widget\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
$form_state
->cleanValues();
$status = $form_state
->getValue('status');
foreach ($form_state
->getValue('sorts') as $key => $v) {
if ($status) {
$this
->validateLabel($form_state, 'label_asc', $key, $v);
$this
->validateLabel($form_state, 'label_desc', $key, $v);
}
}
}