You are here

public static function LightgalleryManager::flattenArray in Lightgallery 8

Flatten array and preserve keys.

Parameters

array $array: The array.

Return value

array The array.

2 calls to LightgalleryManager::flattenArray()
LightGallery::validateOptionsForm in src/Plugin/views/style/LightGallery.php
Form validator.
LightgalleryFormatter::viewElements in src/Plugin/Field/FieldFormatter/LightgalleryFormatter.php
Builds a renderable array for a field value.

File

src/Manager/LightgalleryManager.php, line 247

Class

LightgalleryManager
Light gallery manager.

Namespace

Drupal\lightgallery\Manager

Code

public static function flattenArray(array $array) {
  $flattened_array = [];
  array_walk_recursive($array, function ($a, $key) use (&$flattened_array) {
    $flattened_array[$key] = $a;
  });
  return $flattened_array;
}