function hook_bootstrap_layouts_class_options_alter in Bootstrap Layouts 8.5
Same name and namespace in other branches
- 8.4 bootstrap_layouts.api.php \hook_bootstrap_layouts_class_options_alter()
Alters the list of available classes that can be used in Bootstrap layouts.
Parameters
array $classes: An associative array groups keyed by group machine name, containing another associative array containing key/value pairs where the class is the key and a human readable label is the the value.
$groups: An associative array groups labels keyed by group machine name.
See also
\Drupal\bootstrap_layouts\BootstrapLayoutsManager::getClassOptions
1 invocation of hook_bootstrap_layouts_class_options_alter()
- BootstrapLayoutsManager::getClassOptions in src/
BootstrapLayoutsManager.php - Retrieves classes that can be used in Bootstrap layouts as select options.
File
- ./
bootstrap_layouts.api.php, line 22 - API hooks/callbacks for the Bootstrap Layouts module.
Code
function hook_bootstrap_layouts_class_options_alter(&$classes, &$groups) {
// Add theme specific classes.
$groups['my_theme'] = t('My Theme');
foreach ([
'top',
'middle',
'bottom',
] as $style) {
$classes['my_theme']["section-{$style}"] = t('Section: @style', [
'@style' => Unicode::ucfirst($style),
]);
}
}