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

Breadcrumb

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

function StylePluginBase::getField

Gets a rendered field.

Parameters

int $index: The index count of the row.

string $field: The ID of the field.

Return value

\Drupal\Component\Render\MarkupInterface|null The output of the field, or NULL if it was empty.

1 call to StylePluginBase::getField()
StylePluginBase::renderGrouping in core/modules/views/src/Plugin/views/style/StylePluginBase.php
Group records as needed for rendering.

File

core/modules/views/src/Plugin/views/style/StylePluginBase.php, line 785

Class

StylePluginBase
Base class for views style plugins.

Namespace

Drupal\views\Plugin\views\style

Code

public function getField($index, $field) {
    if (!isset($this->rendered_fields)) {
        $this->renderFields($this->view->result);
    }
    if (isset($this->rendered_fields[$index][$field])) {
        return $this->rendered_fields[$index][$field];
    }
}

API Navigation

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