You are here

public function GridStack::getJson in GridStack 8

Returns the GridStack json suitable for HTML data-attribute.

Parameters

string $group: The option group can be settings or grids.

Return value

string The output of the GridStack json.

Overrides GridStackInterface::getJson

File

src/Entity/GridStack.php, line 170

Class

GridStack
Defines the GridStack configuration entity.

Namespace

Drupal\gridstack\Entity

Code

public function getJson($group = '') {
  $default = self::load('default');
  $defaults = isset($default->json[$group]) ? $default->json[$group] : '';
  return $group && isset($this->json[$group]) ? $this->json[$group] : $defaults;
}