tokenForm example

$options['tokenize'] = ['default' => FALSE];
    return $options;
  }

  /** * {@inheritdoc} */
  public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form$form_state);

    // Add tokenization form elements.     $this->tokenForm($form$form_state);
  }

  /** * Adds tokenization form elements. */
  public function tokenForm(&$form, FormStateInterface $form_state) {
    $form['tokenize'] = [
      '#type' => 'checkbox',
      '#title' => $this->t('Use replacement tokens from the first row'),
      '#default_value' => $this->options['tokenize'],
    ];

    
Home | Imprint | This part of the site doesn't use cookies.