ViewsSystemLibraries.php in Views System 8
File
src/Plugin/views/field/ViewsSystemLibraries.php
View source
<?php
namespace Drupal\views_system\Plugin\views\field;
use Drupal\views\Plugin\views\field\PrerenderList;
class ViewsSystemLibraries extends PrerenderList {
public function preRender(&$values) {
$this->items = array();
foreach ($values as $result) {
$field = $this
->getValue($result);
if (!empty($field) && !isset($this->items[$field])) {
foreach (unserialize($field) as $library) {
$this->items[$field][$library]['name'] = $library;
}
}
}
}
function render_item($count, $item) {
return $item['name'];
}
}