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

Breadcrumb

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

function FieldPluginBase::getPreviousFieldLabels

Returns all field labels of fields before this field.

Return value

array An array of field labels keyed by their field IDs.

2 calls to FieldPluginBase::getPreviousFieldLabels()
FieldPluginBase::buildOptionsForm in core/modules/views/src/Plugin/views/field/FieldPluginBase.php
Default option form that provides label widget that all fields should have.
Links::buildOptionsForm in core/modules/views/src/Plugin/views/field/Links.php
Default option form that provides label widget that all fields should have.

File

core/modules/views/src/Plugin/views/field/FieldPluginBase.php, line 1152

Class

FieldPluginBase
Base class for views fields.

Namespace

Drupal\views\Plugin\views\field

Code

protected function getPreviousFieldLabels() {
    $all_fields = $this->view->display_handler
        ->getFieldLabels();
    $field_options = array_slice($all_fields, 0, array_search($this->options['id'], array_keys($all_fields)));
    return $field_options;
}

API Navigation

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