HijriFormatter.php in Hijri 8.2
File
src/Plugin/Field/FieldFormatter/HijriFormatter.php
View source
<?php
namespace Drupal\hijri\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FormatterBase;
use Drupal;
class HijriFormatter extends FormatterBase {
public function viewElements(FieldItemListInterface $items, $langcode) {
$elements = [];
foreach ($items as $delta => $item) {
$elements[$delta] = [
'#type' => 'markup',
'#markup' => $item->value . ', ' . $item->correction,
];
}
return $elements;
}
}
Classes
Name |
Description |
HijriFormatter |
Plugin implementation of the 'HijriDefaultFormatter' formatter. |