Same name in other branches
- 5.0.x src/Form/InfoForm.php \Drupal\advagg\Form\InfoForm::getFileInfoAjax()
- 6.0.x src/Form/InfoForm.php \Drupal\advagg\Form\InfoForm::getFileInfoAjax()
- 8.x-3.x src/Form/InfoForm.php \Drupal\advagg\Form\InfoForm::getFileInfoAjax()
- 8.x-4.x src/Form/InfoForm.php \Drupal\advagg\Form\InfoForm::getFileInfoAjax()
Display file info via ajax callback.
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 314
Class
- InfoForm
- View AdvAgg information for this site.
Namespace
Drupal\advagg\FormCode
public function getFileInfoAjax(array &$form, FormStateInterface $form_state) {
$element = $form['get_info_about_agg']['wrapper'];
if ($form_state->hasAnyErrors()) {
return $element;
}
$info = $this->getFileInfo($form_state->getValue('filename'));
if (empty($info)) {
$form_state->setErrorByName('filename', $this->t('Please input a valid aggregate filename.'));
return $element;
}
else {
$element['#markup'] = '<pre>' . print_r($info, TRUE) . '</pre>';
return $element;
}
}