Counter.php in Field Slideshow 8.3
File
src/Plugin/FieldSlideshowPager/Counter.php
View source
<?php
namespace Drupal\field_slideshow\Plugin\FieldSlideshowPager;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\field_slideshow\FieldSlideshowPagerPluginBase;
class Counter extends FieldSlideshowPagerPluginBase {
public function viewPager(FieldItemListInterface $items) {
$output = [];
foreach ($items as $delta => $item) {
$output[$delta] = [
'#type' => 'html_tag',
'#tag' => 'span',
'#attributes' => [
'class' => [
'cycle-pager-item',
'cycle-pager-item-' . ($delta + 1),
],
],
'#value' => $delta + 1,
];
}
return $output;
}
}
Classes
Name |
Description |
Counter |
Plugin implementation of the field_slideshow_pager. |