|
|
@ -77,7 +77,6 @@ class TwigExtension extends \Twig_Extension { |
|
|
|
if ($block && $this->entityAccess($block)) { |
|
|
|
if ($block && $this->entityAccess($block)) { |
|
|
|
return $entity_type_manager->getViewBuilder('block')->view($block); |
|
|
|
return $entity_type_manager->getViewBuilder('block')->view($block); |
|
|
|
} |
|
|
|
} |
|
|
|
return NULL; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -145,7 +144,6 @@ class TwigExtension extends \Twig_Extension { |
|
|
|
$render_controller = $entity_type_manager->getViewBuilder($entity_type); |
|
|
|
$render_controller = $entity_type_manager->getViewBuilder($entity_type); |
|
|
|
return $render_controller->view($entity, $view_mode, $langcode); |
|
|
|
return $render_controller->view($entity, $view_mode, $langcode); |
|
|
|
} |
|
|
|
} |
|
|
|
return NULL; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -178,7 +176,6 @@ class TwigExtension extends \Twig_Extension { |
|
|
|
return $entity->{$field_name}->view($view_mode); |
|
|
|
return $entity->{$field_name}->view($view_mode); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return NULL; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -373,6 +370,7 @@ class TwigExtension extends \Twig_Extension { |
|
|
|
* in an <img> tag. Requesting the URL will cause the image to be created. |
|
|
|
* in an <img> tag. Requesting the URL will cause the image to be created. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function imageStyle($path, $style) { |
|
|
|
public function imageStyle($path, $style) { |
|
|
|
|
|
|
|
/** @var \Drupal\Image\ImageStyleInterface $image_style */ |
|
|
|
if ($image_style = ImageStyle::load($style)) { |
|
|
|
if ($image_style = ImageStyle::load($style)) { |
|
|
|
return file_url_transform_relative($image_style->buildUrl($path)); |
|
|
|
return file_url_transform_relative($image_style->buildUrl($path)); |
|
|
|
} |
|
|
|
} |
|
|
|