You are here

protected function FieldValueExtension::isFieldRenderArray 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::isFieldRenderArray()

Checks whether the render array is a field's render array.

Parameters

array|null $build: The render array.

Return value

bool True if $build is a field render array.

4 calls to FieldValueExtension::isFieldRenderArray()
FieldValueExtension::getFieldLabel in src/Twig/Extension/FieldValueExtension.php
Twig filter callback: Only return a field's label.
FieldValueExtension::getFieldValue in src/Twig/Extension/FieldValueExtension.php
Twig filter callback: Only return a field's value(s).
FieldValueExtension::getRawValues in src/Twig/Extension/FieldValueExtension.php
Twig filter callback: Return specific field item(s) value.
FieldValueExtension::getTargetEntity in src/Twig/Extension/FieldValueExtension.php
Twig filter callback: Return the referenced entity.

File

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

Class

FieldValueExtension
Provides field value filters for Twig templates.

Namespace

Drupal\twig_field_value\Twig\Extension

Code

protected function isFieldRenderArray($build) {
  return isset($build['#theme']) && $build['#theme'] == 'field';
}