private function BlazyManager::backgroundImage in Blazy 8.2
Prepares CSS background image.
2 calls to BlazyManager::backgroundImage()
- BlazyManager::buildImage in src/
BlazyManager.php - Build out image, or anything related, including cache, CSS background, etc.
- BlazyManager::buildResponsiveImage in src/
BlazyManager.php - Build out Responsive image.
File
- src/
BlazyManager.php, line 331
Class
- BlazyManager
- Implements a public facing blazy manager.
Namespace
Drupal\blazyCode
private function backgroundImage(array $settings, $style = NULL) {
return [
'src' => $style ? BlazyUtil::transformRelative($settings['uri'], $style) : $settings['image_url'],
'ratio' => round($settings['height'] / $settings['width'] * 100, 2),
];
}