function FieldPluginBase::getPreviousFieldLabels

Same name and namespace in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::getPreviousFieldLabels()
  2. 10 core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::getPreviousFieldLabels()
  3. 11.x core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\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 1106

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.