protected function ResponsiveMenusPluginBase::getSettingArray in Responsive Menus 8
Return array of selectors for JS settings.
@params string $name The settings name.
Return value
array Array of settings to pass with drupal_add_js().
3 calls to ResponsiveMenusPluginBase::getSettingArray()
- CodropsGoogleNexus::getJsSettings in src/
Plugin/ ResponsiveMenus/ CodropsGoogleNexus.php - Get Drupal Javscript settings array.
- ResponsiveMenusSimple::getJsSettings in src/
Plugin/ ResponsiveMenus/ ResponsiveMenusSimple.php - Get Drupal Javscript settings array.
- Sidr::getJsSettings in src/
Plugin/ ResponsiveMenus/ Sidr.php - Get Drupal Javscript settings array.
File
- src/
ResponsiveMenusPluginBase.php, line 54
Class
- ResponsiveMenusPluginBase
- Class ResponsiveMenusPluginBase.
Namespace
Drupal\responsive_menusCode
protected function getSettingArray($name) {
$selectors = $this
->getSetting($name);
$delimiter = ', ';
// Strip out carriage returns.
$selectors = str_replace("\r", '', $selectors);
// Replace new lines with delimiter.
$selectors = str_replace("\n", $delimiter, $selectors);
// Explode to include original delimited.
$values = explode($delimiter, $selectors);
$values = array_filter($values);
return $values;
}