You are here

public function SendTestMessageForm::validateForm in Slack 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/SendTestMessageForm.php, line 75

Class

SendTestMessageForm
Class SendTestMessageForm.

Namespace

Drupal\slack\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if (empty($this
    ->config('slack.settings')
    ->get('slack_webhook_url'))) {
    $form_state
      ->setRedirect('slack.admin_settings');
  }
}