Variant.php in GridStack 8.2
File
src/Plugin/gridstack/engine/Variant.php
View source
<?php
namespace Drupal\gridstack\Plugin\gridstack\engine;
use Drupal\gridstack\GridStackEnginePluginBase;
use Drupal\gridstack\Entity\GridStackVariant;
class Variant extends GridStackEnginePluginBase {
public function override(&$optionset, array &$settings) {
$variant = NULL;
if (isset($settings['vid']) && ($vid = $settings['vid'])) {
$variant = GridStackVariant::load($vid);
if ($variant && ($breakpoints = $variant
->getBreakpoints())) {
$optionset
->setOptions([
'breakpoints' => $breakpoints,
]);
$settings['_variant'] = $variant
->label();
}
}
return $variant;
}
}
Classes
Name |
Description |
Variant |
Provides a shadow variant layout engine. |