public function SlickManager::attachSkin in Slick Carousel 8
Same name and namespace in other branches
- 8.2 src/SlickManager.php \Drupal\slick\SlickManager::attachSkin()
- 7.3 src/SlickManager.php \Drupal\slick\SlickManager::attachSkin()
Provides skins only if required.
1 call to SlickManager::attachSkin()
File
- src/
SlickManager.php, line 173
Class
- SlickManager
- Implements BlazyManagerInterface, SlickManagerInterface.
Namespace
Drupal\slickCode
public function attachSkin(array &$load, $attach = []) {
if ($attach['slick_css']) {
$load['library'][] = 'slick/slick.css';
}
if ($attach['module_css']) {
$load['library'][] = 'slick/slick.theme';
}
if (!empty($attach['thumbnail_effect'])) {
$load['library'][] = 'slick/slick.thumbnail.' . $attach['thumbnail_effect'];
}
if (!empty($attach['down_arrow'])) {
$load['library'][] = 'slick/slick.arrow.down';
}
foreach (self::getConstantSkins() as $group) {
$skin = $group == 'main' ? $attach['skin'] : (isset($attach['skin_' . $group]) ? $attach['skin_' . $group] : '');
if (!empty($skin)) {
$skins = $this
->getSkinsByGroup($group);
$provider = isset($skins[$skin]['provider']) ? $skins[$skin]['provider'] : 'slick';
$load['library'][] = 'slick/' . $provider . '.' . $group . '.' . $skin;
}
}
}