You are here

public function GridStack::getBreakpointGrids in GridStack 8

Returns options.breakpoints.sm.[width, column, image_style, grids, nested].

3 calls to GridStack::getBreakpointGrids()
GridStack::getBreakpointGrid in src/Entity/GridStack.php
Returns options.breakpoints.sm.[width, column, image_style, grids, nested].
GridStack::getEndBreakpointGrids in src/Entity/GridStack.php
Returns options.breakpoints.[lg|xl].[grids|nested].
GridStack::getJsonSummaryBreakpoints in src/Entity/GridStack.php
Returns JSON for options.breakpoints.

File

src/Entity/GridStack.php, line 244

Class

GridStack
Defines the GridStack configuration entity.

Namespace

Drupal\gridstack\Entity

Code

public function getBreakpointGrids($breakpoint = 'lg', $current = 'grids') {
  $grids = !empty($this
    ->getBreakpoints($breakpoint)) && isset($this
    ->getBreakpoints($breakpoint)[$current]) ? $this
    ->getBreakpoints($breakpoint)[$current] : '';
  $grids = Json::decode($grids);
  if ($grids) {
    return $current == 'grids' ? array_filter($grids) : $grids;
  }
  return [];
}