class GridStackFormatter in GridStack 8
Same name and namespace in other branches
- 8.2 src/GridStackFormatter.php \Drupal\gridstack\GridStackFormatter
Implements GridStackFormatterInterface.
Hierarchy
- class \Drupal\gridstack\GridStackFormatter extends \Drupal\blazy\BlazyFormatterManager implements GridStackFormatterInterface
Expanded class hierarchy of GridStackFormatter
1 string reference to 'GridStackFormatter'
1 service uses GridStackFormatter
File
- src/
GridStackFormatter.php, line 11
Namespace
Drupal\gridstackView source
class GridStackFormatter extends BlazyFormatterManager implements GridStackFormatterInterface {
/**
* {@inheritdoc}
*/
public function buildSettings(array &$build, $items) {
$settings =& $build['settings'];
// Prepare integration with Blazy.
$settings['item_id'] = 'box';
$settings['namespace'] = 'gridstack';
// Pass basic info to parent::buildSettings().
parent::buildSettings($build, $items);
// GridStack specific stuffs.
$build['optionset'] = GridStack::load($settings['optionset']);
// Ensures deleted optionset while being used doesn't screw up.
if (empty($build['optionset'])) {
$build['optionset'] = GridStack::load('default');
}
// Converts gridstack breakpoint grids from stored JSON into array.
unset($settings['breakpoints']);
$build['optionset']
->gridsJsonToArray($settings);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GridStackFormatter:: |
public | function |