You are here

public function MessageTemplateMultipleTextField::__construct in Message 8

Constructing the element.

Parameters

\Drupal\message\Entity\MessageTemplate $entity: A message template.

string $callback: The name of the ajax callback.

string $langcode: The language of the message. Used for the message translation form.

File

src/FormElement/MessageTemplateMultipleTextField.php, line 42

Class

MessageTemplateMultipleTextField
Helper class to construct a multiple text field form.

Namespace

Drupal\message\FormElement

Code

public function __construct(MessageTemplate $entity, $callback, $langcode = '') {
  $this->entity = $entity;
  $this->callback = $callback;
  $this->langcode = $langcode ? $langcode : \Drupal::languageManager()
    ->getCurrentLanguage()
    ->getId();
}