public function GridActionForm::validateForm in Filebrowser 3.x
Same name and namespace in other branches
- 8.2 src/Form/GridActionForm.php \Drupal\filebrowser\Form\GridActionForm::validateForm()
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/ GridActionForm.php, line 181
Class
- GridActionForm
- Class GridActionForm.
Namespace
Drupal\filebrowser\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
// All submit button needs selected items. If noting selected generate form_error
$element = $form_state
->getTriggeringElement();
$this->fids = $this
->getFids($form, $form_state);
if (empty($this->fids)) {
$form_state
->setError($element, $this
->t('You didn\'t select any item'));
}
}