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

Breadcrumb

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

function LinkBase::buildOptionsForm

Overrides FieldPluginBase::buildOptionsForm

4 calls to LinkBase::buildOptionsForm()
ContactLink::buildOptionsForm in core/modules/contact/src/Plugin/views/field/ContactLink.php
Default option form that provides label widget that all fields should have.
ContactLink::buildOptionsForm in core/modules/contact/src/Plugin/views/field/ContactLink.php
Default option form that provides label widget that all fields should have.
EntityLink::buildOptionsForm in core/modules/views/src/Plugin/views/field/EntityLink.php
Default option form that provides label widget that all fields should have.
EntityLink::buildOptionsForm in core/modules/views/src/Plugin/views/field/EntityLink.php
Default option form that provides label widget that all fields should have.
2 methods override LinkBase::buildOptionsForm()
ContactLink::buildOptionsForm in core/modules/contact/src/Plugin/views/field/ContactLink.php
Default option form that provides label widget that all fields should have.
EntityLink::buildOptionsForm in core/modules/views/src/Plugin/views/field/EntityLink.php
Default option form that provides label widget that all fields should have.

File

core/modules/views/src/Plugin/views/field/LinkBase.php, line 130

Class

LinkBase
Field handler to present a link to an entity.

Namespace

Drupal\views\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() so we do not allow to set it.
    $form['alter'] += [
        'path' => [],
        'query' => [],
        'external' => [],
    ];
    $form['alter']['path'] += [
        '#access' => FALSE,
    ];
    $form['alter']['query'] += [
        '#access' => FALSE,
    ];
    $form['alter']['external'] += [
        '#access' => FALSE,
    ];
}

API Navigation

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