Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. IconFinder.php

function IconFinder::extractGroupFromPath

Extracts the group from a file path based on the group position.

Parameters

string $path: The file path.

int|null $group_position: The position of the group in the path, or null if not applicable.

Return value

string|null The extracted group, or null if not found.

1 call to IconFinder::extractGroupFromPath()
IconFinder::processFoundFiles in core/lib/Drupal/Core/Theme/Icon/IconFinder.php
Process files and format icon information.

File

core/lib/Drupal/Core/Theme/Icon/IconFinder.php, line 351

Class

IconFinder
Icon finder to discover files under specific paths or URLs.

Namespace

Drupal\Core\Theme\Icon

Code

private static function extractGroupFromPath(string $path, ?int $group_position) : ?string {
    $parts = explode('/', trim($path, '/'));
    return $parts[$group_position] ?? NULL;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal