You are here

public function Loader::loadImage in Bamboo Twig 8.3

Same name and namespace in other branches
  1. 8.5 bamboo_twig_loader/src/TwigExtension/Loader.php \Drupal\bamboo_twig_loader\TwigExtension\Loader::loadImage()
  2. 8.2 bamboo_twig_loader/src/TwigExtension/Loader.php \Drupal\bamboo_twig_loader\TwigExtension\Loader::loadImage()
  3. 8.4 bamboo_twig_loader/src/TwigExtension/Loader.php \Drupal\bamboo_twig_loader\TwigExtension\Loader::loadImage()

Load a ImageInterface object for an original image path or URI.

Parameters

string $path: The path or URI to the original image.

Return value

\Drupal\Core\Image\ImageInterface An Image object.

File

bamboo_twig_loader/src/TwigExtension/Loader.php, line 118

Class

Loader
Provides some loaders as Twig Extensions.

Namespace

Drupal\bamboo_twig_loader\TwigExtension

Code

public function loadImage($path) {
  return $this
    ->getImageFactory()
    ->get($path);
}