You are here

public static function IsotopeController::libraryMapping in Isotope (with Masonry and Packery) 8

Given a layout name return the name of a library to load.

Parameters

string|array $properties: Name of layout mode or other plugin.

Return value

array Array of library names to load, keyed by property name.

1 call to IsotopeController::libraryMapping()
template_preprocess_isotope_grid in ./isotope.theme.inc
Prepares variables for isotope grid template.

File

src/Controller/IsotopeController.php, line 55
Contains \Drupal\isotope\Controller\IsotopeController.

Class

IsotopeController
Controller routines for admin block routes.

Namespace

Drupal\isotope\Controller

Code

public static function libraryMapping($properties) {
  $properties = (array) $properties;
  $mappings = [
    'cellsByColumn' => 'isotope/isotope-cells-by-column',
    'cellsByRow' => 'isotope/isotope-cells-by-row',
    'fitColumns' => 'isotope/isotope-fit-columns',
    'fitRows' => 'isotope/isotope-layout',
    'horiz' => 'isotope/isotope-horizontal',
    'imagesloaded' => 'isotope/imagesloaded',
    'masonry' => 'isotope/isotope-layout',
    'masonryHorizontal' => 'isotope/isotope-masonry-horizontal',
    'packery' => 'isotope/packery',
    'vertical' => 'isotope/isotope-layout',
  ];
  return array_intersect_key($mappings, array_flip($properties));
}