You are here

protected function ModuleRouteSubscriber::explodeString in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/EventSubscriber/ModuleRouteSubscriber.php \Drupal\Core\EventSubscriber\ModuleRouteSubscriber::explodeString()
  2. 9 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.

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