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
1 2 3 4 5 | 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.