function ModuleRouteSubscriber::explodeString

Same name in other branches
  1. 9 core/lib/Drupal/Core/EventSubscriber/ModuleRouteSubscriber.php \Drupal\Core\EventSubscriber\ModuleRouteSubscriber::explodeString()
  2. 10 core/lib/Drupal/Core/EventSubscriber/ModuleRouteSubscriber.php \Drupal\Core\EventSubscriber\ModuleRouteSubscriber::explodeString()
  3. 11.x 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 75

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)));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.