Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Links.php

function Links::buildOptionsForm

Overrides FieldPluginBase::buildOptionsForm

File

core/modules/views/src/Plugin/views/field/Links.php, line 68

Class

Links
An abstract handler which provides a collection of links.

Namespace

Drupal\views\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
    // Only show fields that precede this one.
    $field_options = $this->getPreviousFieldLabels();
    $form['fields'] = [
        '#type' => 'checkboxes',
        '#title' => $this->t('Fields'),
        '#description' => $this->t('Fields to be included as links.'),
        '#options' => $field_options,
        '#default_value' => $this->options['fields'],
    ];
    $form['destination'] = [
        '#type' => 'checkbox',
        '#title' => $this->t('Include destination'),
        '#description' => $this->t('Include a "destination" parameter in the link to return the user to the original view upon completing the link action.'),
        '#default_value' => $this->options['destination'],
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal