public function BatchWatermarkForm::validateForm in Media watermark 8
Form validation handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: An associative array containing the current state of the form.
Overrides FormBase::validateForm
File
- src/
Form/ BatchWatermarkForm.php, line 136
Class
- BatchWatermarkForm
- Class BatchWatermarkForm.
Namespace
Drupal\media_watermark\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
$fids = $this
->checkFiles($form_state
->getValue('files'));
if (empty($fids)) {
$form_state
->setErrorByName('files', $this
->t('Please select files to add watermarks'));
}
}