You are here

public static function Blazy::buildResponsiveImage in Blazy 8

Same name and namespace in other branches
  1. 8.2 src/Blazy.php \Drupal\blazy\Blazy::buildResponsiveImage()

Modifies variables for Responsive image.

1 call to Blazy::buildResponsiveImage()
Blazy::buildAttributes in src/Blazy.php
Prepares variables for blazy.html.twig templates.

File

src/Blazy.php, line 81

Class

Blazy
Implements BlazyInterface.

Namespace

Drupal\blazy

Code

public static function buildResponsiveImage(array &$variables) {
  $image =& $variables['image'];
  $settings =& $variables['settings'];
  $image['#type'] = 'responsive_image';
  $image['#responsive_image_style_id'] = $settings['responsive_image_style_id'];
  $image['#uri'] = $settings['uri'];

  // Disable aspect ratio which is not yet supported due to complexity.
  $settings['ratio'] = FALSE;
}