function StylePluginBase::render_fields

Render all of the fields for a given style and store them on the object.

Parameters

$result: The result array from $view->result

2 calls to StylePluginBase::render_fields()
StylePluginBase::get_field in drupal/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php
Get a rendered field.
StylePluginBase::render_grouping in drupal/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php
Group records as needed for rendering.

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php, line 601
Definition of Drupal\views\Plugin\views\style\StylePluginBase.

Class

StylePluginBase
Base class to define a style plugin handler.

Namespace

Drupal\views\Plugin\views\style

Code

function render_fields($result) {
  if (!$this
    ->usesFields()) {
    return;
  }
  if (!isset($this->rendered_fields)) {
    $this->rendered_fields = array();
    $this->view->row_index = 0;
    $keys = array_keys($this->view->field);

    // If all fields have a field::access FALSE there might be no fields, so
    // there is no reason to execute this code.
    if (!empty($keys)) {
      foreach ($result as $count => $row) {
        $this->view->row_index = $count;
        foreach ($keys as $id) {
          $this->rendered_fields[$count][$id] = $this->view->field[$id]
            ->theme($row);
        }
        $this->row_tokens[$count] = $this->view->field[$id]
          ->get_render_tokens(array());
      }
    }
    unset($this->view->row_index);
  }
  return $this->rendered_fields;
}