You are here

public function Date::render_item in Views XML Backend 8

Renders a single item of a row.

Parameters

int $count: The index of the item inside the row.

mixed $item: The item for the field to render.

Return value

string The rendered output.

Overrides XmlFieldHelperTrait::render_item

See also

\Drupal\views\Plugin\views\field\MultiItemsFieldHandlerInterface

File

src/Plugin/views/field/Date.php, line 48
Contains \Drupal\views_xml_backend\Plugin\views\field\Date.

Class

Date
A handler to provide an XML date field.

Namespace

Drupal\views_xml_backend\Plugin\views\field

Code

public function render_item($count, $item) {
  $tmp_row = new ResultRow();
  if (!is_numeric($item['value'])) {
    $tmp_row->{$this->field_alias} = strtotime($item['value']);
  }
  else {
    $tmp_row->{$this->field_alias} = $item['value'];
  }
  return parent::render($tmp_row);
}