You are here

public function InfoForm::getFileInfoValidate in Advanced CSS/JS Aggregation 8.4

Same name and namespace in other branches
  1. 8.2 src/Form/InfoForm.php \Drupal\advagg\Form\InfoForm::getFileInfoValidate()
  2. 8.3 src/Form/InfoForm.php \Drupal\advagg\Form\InfoForm::getFileInfoValidate()

Verify that the filename is correct.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

File

src/Form/InfoForm.php, line 224

Class

InfoForm
View AdvAgg information for this site.

Namespace

Drupal\advagg\Form

Code

public function getFileInfoValidate(array $form, FormStateInterface $form_state) {
  if (empty($form_state
    ->getValue('filename'))) {
    $form_state
      ->setErrorByName('filename', $this
      ->t('Please input a valid optimized filename.'));
  }
}