function MessageAction::buildConfigurationForm

Same name in other branches
  1. 9 core/lib/Drupal/Core/Action/Plugin/Action/MessageAction.php \Drupal\Core\Action\Plugin\Action\MessageAction::buildConfigurationForm()
  2. 8.9.x core/lib/Drupal/Core/Action/Plugin/Action/MessageAction.php \Drupal\Core\Action\Plugin\Action\MessageAction::buildConfigurationForm()
  3. 11.x core/lib/Drupal/Core/Action/Plugin/Action/MessageAction.php \Drupal\Core\Action\Plugin\Action\MessageAction::buildConfigurationForm()

Overrides PluginFormInterface::buildConfigurationForm

File

core/lib/Drupal/Core/Action/Plugin/Action/MessageAction.php, line 107

Class

MessageAction
Sends a message to the current user's screen.

Namespace

Drupal\Core\Action\Plugin\Action

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $form['message'] = [
        '#type' => 'textarea',
        '#title' => $this->t('Message'),
        '#default_value' => $this->configuration['message'],
        '#required' => TRUE,
        '#rows' => '8',
        '#description' => $this->t('The message to be displayed to the current user. You may include placeholders like [node:title], [user:account-name], [user:display-name] and [comment:body] to represent data that will be different each time message is sent. Not all placeholders will be available in all contexts.'),
    ];
    return $form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.