function hook_lazy_settings_alter in Lazy-load 8.3
Alter Lazy module settings.
The module settings can be overridden completely, or partially for any given condition.
Parameters
array $settings: The Lazy module settings.
1 invocation of hook_lazy_settings_alter()
- Lazy::getSettings in src/
Lazy.php - Get Lazy module settings.
File
- ./
lazy.api.php, line 89 - Lazy-load API.
Code
function hook_lazy_settings_alter(array &$settings) {
switch ($_SERVER['HTTP_HOST']) {
case 'example.com':
$settings['libraryPath'] = 'https://cdn.example.com/libraries/lazysizes';
break;
case 'demo1.example.com':
$settings['libraryPath'] = '/demo-assets/lazysizes';
break;
}
}