You are here

protected function ModuleRouteSubscriber::explodeString in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/EventSubscriber/ModuleRouteSubscriber.php \Drupal\Core\EventSubscriber\ModuleRouteSubscriber::explodeString()

Explodes a string based on a separator.

Parameters

string $string: The string to explode.

string $separator: The string separator to explode with.

Return value

array An array of exploded (and trimmed) values.

1 call to ModuleRouteSubscriber::explodeString()
ModuleRouteSubscriber::alterRoutes in core/lib/Drupal/Core/EventSubscriber/ModuleRouteSubscriber.php
Alters existing routes for a specific collection.

File

core/lib/Drupal/Core/EventSubscriber/ModuleRouteSubscriber.php, line 80
Contains \Drupal\Core\EventSubscriber\ModuleRouteSubscriber.

Class

ModuleRouteSubscriber
A route subscriber to remove routes that depend on modules being enabled.

Namespace

Drupal\Core\EventSubscriber

Code

protected function explodeString($string, $separator = ',') {
  return array_filter(array_map('trim', explode($separator, $string)));
}