public function DateApStyle::getFilters in AP Style Date 8
Generates a list of all Twig filters that this extension defines.
Return value
array A key/value array that defines custom Twig filters. The key denotes the filter name used in the tag, e.g.:
{{ foo|testfilter }}
The value is a standard PHP callback that defines what the filter does.
File
- src/
TwigExtension/ DateApStyle.php, line 43
Class
- DateApStyle
- Custom twig filter to display dates as AP Style.
Namespace
Drupal\date_ap_style\TwigExtensionCode
public function getFilters() {
return [
new TwigFilter('ap_style', [
$this->apStyleDateFormatter,
'formatTimestamp',
]),
];
}