You are here

public function MixitupViewsDefaultOptionsService::convertFromMixitupOptions in MixItUp Views 8.2

Same name and namespace in other branches
  1. 8 src/MixitupViewsDefaultOptionsService.php \Drupal\mixitup_views\MixitupViewsDefaultOptionsService::convertFromMixitupOptions()

Convert mixitup options array to needed.

Parameters

array $mixitup_options: Options array in mixitup js style.

Return value

array Converted array of mixitup params.

1 call to MixitupViewsDefaultOptionsService::convertFromMixitupOptions()
MixitupViewsDefaultOptionsService::defaultOptions in src/MixitupViewsDefaultOptionsService.php
Get default option for mixitup js.

File

src/MixitupViewsDefaultOptionsService.php, line 60

Class

MixitupViewsDefaultOptionsService
Class MixitupViewsDefaultOptions.

Namespace

Drupal\mixitup_views

Code

public function convertFromMixitupOptions(array $mixitup_options) {
  $converted_options = [];
  foreach ($mixitup_options as $cat => $options) {
    foreach ($options as $option => $default_value) {
      $converted_options[$cat . '_' . $option] = $default_value;
    }
  }
  return $converted_options;
}