You are here

public function view::render_field in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 includes/view.inc \view::render_field()
  2. 6.2 includes/view.inc \view::render_field()

Render a specific field via the field ID and the row #.

Note: You might want to use views_plugin_style::render_fields as it caches the output for you.

Parameters

string $field: The id of the field to be rendered.

int $row: The row number in the $view->result which is used for the rendering.

Return value

string The rendered output of the field.

File

includes/view.inc, line 1366
views_objects Objects that represent a View or part of a view

Class

view
An object to contain all of the data to generate a view.

Code

public function render_field($field, $row) {
  if (isset($this->field[$field]) && isset($this->result[$row])) {
    return $this->field[$field]
      ->advanced_render($this->result[$row]);
  }
}