You are here

public function Link::buildOptionsForm in Simplenews 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/views/field/Link.php \Drupal\simplenews\Plugin\views\field\Link::buildOptionsForm()
  2. 3.x src/Plugin/views/field/Link.php \Drupal\simplenews\Plugin\views\field\Link::buildOptionsForm()

Default options form that provides the label widget that all fields should have.

Overrides FieldPluginBase::buildOptionsForm

File

src/Plugin/views/field/Link.php, line 37

Class

Link
Field handler to present a link to the subscriber.

Namespace

Drupal\simplenews\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  $form['text'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Text to display'),
    '#default_value' => $this->options['text'],
  ];
  parent::buildOptionsForm($form, $form_state);

  // The path is set by renderLink function so don't allow to set it.
  $form['alter']['path'] = [
    '#access' => FALSE,
  ];
  $form['alter']['external'] = [
    '#access' => FALSE,
  ];
}