You are here

public function StaticGeneratorForm::validateForm in Tome 8

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

modules/tome_static/src/Form/StaticGeneratorForm.php, line 138

Class

StaticGeneratorForm
Contains a form for initializing a static build.

Namespace

Drupal\tome_static\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if (!UrlHelper::isValid($form_state
    ->getValue('base_url'), TRUE)) {
    $form_state
      ->setError($form['base_url'], $this
      ->t('The provided URL is not valid.'));
  }
}