You are here

ExplodedListField.php in Legal 8

Same filename and directory in other branches
  1. 2.0.x src/Plugin/views/field/ExplodedListField.php

File

src/Plugin/views/field/ExplodedListField.php
View source
<?php

namespace Drupal\legal\Plugin\views\field;

use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\ResultRow;

/**
 * Field handler to flag the node type.
 *
 * @ingroup views_field_handlers
 *
 * @ViewsField("exploded_list")
 */
class ExplodedListField extends FieldPluginBase {

  /**
   * {@inheritdoc}
   */
  public function render(ResultRow $values) {
    $changes = explode("\r\n", $values->{$this->field_alias});
    $build = [
      '#theme' => 'item_list',
      '#items' => $changes,
    ];
    return $build;
  }

}

Classes

Namesort descending Description
ExplodedListField Field handler to flag the node type.