You are here

public function GoogleNewsFields::getField in Views Google News 8

Retrieves a views field value from the style plugin.

Parameters

int $index: The index count of the row as expected by views_plugin_style::getField().

int $field_id: The ID assigned to the required field in the display.

Return value

string The field value.

1 call to GoogleNewsFields::getField()
GoogleNewsFields::render in src/Plugin/views/row/GoogleNewsFields.php
Render a row object. This usually passes through to a theme template of some form, but not always.

File

src/Plugin/views/row/GoogleNewsFields.php, line 187

Class

GoogleNewsFields
Renders an GoogleNews item based on fields.

Namespace

Drupal\views_googlenews\Plugin\views\row

Code

public function getField($index, $field_id) {
  if (empty($this->view->style_plugin) || !is_object($this->view->style_plugin) || empty($field_id)) {
    return '';
  }
  return $this->view->style_plugin
    ->getField($index, $field_id);
}