You are here

public function SmsSettingsForm::validateForm in SMS Framework 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

src/Form/SmsSettingsForm.php, line 105

Class

SmsSettingsForm
Provides a form for SMS settings.

Namespace

Drupal\sms\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  $verify = $form_state
    ->getValue([
    'pages',
    'verify',
  ]);
  if (substr($verify, 0, 1) !== '/') {
    $form_state
      ->setError($form['pages']['verify'], $this
      ->t("Path must begin with a '/' character."));
  }
}