public static function Blazy::lazyAttributes in Blazy 7
Same name and namespace in other branches
- 8.2 src/Blazy.php \Drupal\blazy\Blazy::lazyAttributes()
1 call to Blazy::lazyAttributes()
- BlazyManager::buildImage in src/BlazyManager.php
- Build out image, or anything related, including cache, CSS background, etc.
File
- src/Blazy.php, line 166
Class
- Blazy
- Implements BlazyInterface.
Namespace
Drupal\blazy
Code
public static function lazyAttributes(array &$attributes, array $settings = []) {
$attributes['class'][] = $settings['lazy_class'];
$attributes['data-' . $settings['lazy_attribute']] = $settings['image_url'];
$attributes['loading'] = 'lazy';
}