You are here

GridStackEnginePluginInterface.php in GridStack 8.2

Namespace

Drupal\gridstack

File

src/GridStackEnginePluginInterface.php
View source
<?php

namespace Drupal\gridstack;


/**
 * Provides an interface defining GridStack layout engines.
 */
interface GridStackEnginePluginInterface extends GridStackPluginInterface {

  /**
   * Returns the layout engine classes for select options.
   *
   * @return array
   *   The array of the defined classes.
   */
  public function classOptions();

  /**
   * Alters GridStack build.
   *
   * @param array $build
   *   An associative array containing:
   *   - items: An array of gridstack contents: text, image or media.
   *   - options: An array of key:value pairs of custom JS options.
   *   - optionset: The cached optionset object to avoid multiple invocations.
   *   - settings: An array of key:value pairs of HTML/layout related settings.
   * @param array $element
   *   The render element being modified.
   */
  public function build(array &$build, array &$element);

  /**
   * Builds GridStack boxes to support nested grids for Bootstrap/ Foundation.
   *
   * The nested grids require extra tools like DS, Panelizer, or Widget, to
   * arrange them into their relevant container, e.g.: DS region, Widget block.
   *
   * @param array $build
   *   An associative array containing:
   *   - items: An array of gridstack contents: text, image or media.
   *   - options: An array of key:value pairs of custom JS options.
   *   - optionset: The cached optionset object to avoid multiple invocations.
   *   - settings: An array of key:value pairs of HTML/layout related settings.
   *
   * @return array
   *   The renderable array of a GridStack instance, or empty array.
   */
  public function buildItems(array $build);

}

Interfaces

Namesort descending Description
GridStackEnginePluginInterface Provides an interface defining GridStack layout engines.