You are here

public function FieldValueExtension::getFilters in Twig Field Value 8

Same name and namespace in other branches
  1. 2.0.x src/Twig/Extension/FieldValueExtension.php \Drupal\twig_field_value\Twig\Extension\FieldValueExtension::getFilters()

File

src/Twig/Extension/FieldValueExtension.php, line 16

Class

FieldValueExtension
Provides field value filters for Twig templates.

Namespace

Drupal\twig_field_value\Twig\Extension

Code

public function getFilters() {
  return [
    new \Twig_SimpleFilter('field_label', [
      $this,
      'getFieldLabel',
    ]),
    new \Twig_SimpleFilter('field_value', [
      $this,
      'getFieldValue',
    ]),
    new \Twig_SimpleFilter('field_raw', [
      $this,
      'getRawValues',
    ]),
    new \Twig_SimpleFilter('field_target_entity', [
      $this,
      'getTargetEntity',
    ]),
  ];
}