public DblogFilterForm::validateForm(array &$form, FormStateInterface $form_state)
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
- core/modules/dblog/src/Form/DblogFilterForm.php, line 66
Class
- DblogFilterForm
- Provides the database logging filter form.
Namespace
Drupal\dblog\Form
Code
public function validateForm(array &$form, FormStateInterface $form_state) { if ($form_state->isValueEmpty('type') && $form_state->isValueEmpty('severity')) { $form_state->setErrorByName('type', $this->t('You must select something to filter by.')); } }
Please login to continue.