public static function ViewsBootstrap::getColSize in Views Bootstrap 8.3
Same name and namespace in other branches
- 8.4 src/ViewsBootstrap.php \Drupal\views_bootstrap\ViewsBootstrap::getColSize()
Get the number of items from the column class string.
Parameters
string $size: Bootstrap grid size xs|sm|md|lg.
Return value
int|false Number of columns in a 12 column grid or false.
1 call to ViewsBootstrap::getColSize()
- template_preprocess_views_bootstrap_grid in ./
views_bootstrap.theme.inc - Prepares variables for views grid templates.
File
- src/
ViewsBootstrap.php, line 117
Class
- ViewsBootstrap
- The primary class for the Views Bootstrap module.
Namespace
Drupal\views_bootstrapCode
public static function getColSize($size) {
if (preg_match('~col-[a-z]{2}-([0-9]*)~', $size, $matches)) {
return 12 / $matches[1];
}
return FALSE;
}