|
|
@ -192,7 +192,7 @@ class TwigTweakExtension extends AbstractExtension { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the render array for a single entity field. |
|
|
|
* Returns the render array for a single entity field. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static function drupalField(string $field_name, string $entity_type, string $id, string $view_mode = 'full', string $langcode = NULL, bool $check_access = TRUE): array { |
|
|
|
public static function drupalField(string $field_name, string $entity_type, string $id, $view_mode = 'full', string $langcode = NULL, bool $check_access = TRUE): array { |
|
|
|
$entity = \Drupal::entityTypeManager()->getStorage($entity_type)->load($id); |
|
|
|
$entity = \Drupal::entityTypeManager()->getStorage($entity_type)->load($id); |
|
|
|
if ($entity) { |
|
|
|
if ($entity) { |
|
|
|
return \Drupal::service('twig_tweak.field_view_builder') |
|
|
|
return \Drupal::service('twig_tweak.field_view_builder') |
|
|
|