5 * API hooks/callbacks for the Bootstrap Layouts module.
8 use Drupal\Component\Utility\Unicode;
11 * Alters the list of available classes that can be used in Bootstrap layouts.
13 * @param array $classes
14 * An associative array groups keyed by group machine name, containing
15 * another associative array containing key/value pairs where the class
16 * is the key and a human readable label is the the value.
18 * An associative array groups labels keyed by group machine name.
20 * @see \Drupal\bootstrap_layouts\BootstrapLayoutsManager::getClassOptions
22 function hook_bootstrap_layouts_class_options_alter(&$classes, &$groups) {
23 // Add theme specific classes.
24 $groups['my_theme'] = t('My Theme');
25 foreach (['top', 'middle', 'bottom'] as $style) {
26 $classes['my_theme']["section-$style"] = t('Section: @style', ['@style' => Unicode::ucfirst($style)]);