You are here

public function BroadcastForm::submitForm in Node.js integration 8

Form submission 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 FormInterface::submitForm

File

nodejs_notify/src/Form/BroadcastForm.php, line 52

Class

BroadcastForm
Class BroadcastForm

Namespace

Drupal\nodejs_notify\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  nodejs_broadcast_message($form_state
    ->getValue('broadcast_subject'), $form_state
    ->getValue('broadcast_message'));
  $this
    ->messenger()
    ->addStatus(t("Message broadcast to all users"));
}