You are here

public function TomeStaticCronSettingsForm::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/modules/tome_static_cron/src/Form/TomeStaticCronSettingsForm.php, line 51

Class

TomeStaticCronSettingsForm
Configures Tome Static Cron settings for this site.

Namespace

Drupal\tome_static_cron\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.'));
  }
}