Account created on 11 June 2006, over 18 years ago
#

Recent comments

🇳🇴Norway farald

You can also use a static method inside the same plugin class:

    $form['delete_queue'] = [
      '#type' => 'submit',
      '#value' => $this->t('Delete queue'),
      '#submit' => ['\Drupal\mymodule\Plugin\Formalter\UserFormAlter::deleteQueue'],
      '#button_type' => 'primary',
    ];

And then add a static:

  public static function deleteQueue(array &$form, FormStateInterface $form_state) {
    \Drupal::messenger()->addMessage(t("Deleted @queue successfully."));
  }
Production build 0.71.5 2024