public function Breakpoint::getClassByPosition in Bootstrap Layout Builder 2.x
Same name and namespace in other branches
- 1.x src/Entity/Breakpoint.php \Drupal\bootstrap_layout_builder\Entity\Breakpoint::getClassByPosition()
Returns region class of a breakpoint.
Parameters
string $key: The position of region.
string $strucutre_id: The layout option structure id.
Return value
string The class of a region.
Overrides BreakpointInterface::getClassByPosition
File
- src/
Entity/ Breakpoint.php, line 123
Class
- Breakpoint
- Defines the Breakpoint config entity.
Namespace
Drupal\bootstrap_layout_builder\EntityCode
public function getClassByPosition($key, $strucutre_id) {
$strucutre = substr($strucutre_id, strlen('blb_col_'));
$strucutre = explode('_', $strucutre);
// Full width case.
$sufix = '12';
if (count($strucutre) > 1) {
$sufix = $strucutre[$key];
}
$class = $this
->getBaseClass() . '-' . $sufix;
return $class;
}