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

Breadcrumb

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

function IconFinder::determineGroupPosition

Determines the group position based on the URI.

The group position is needed to use it as a mask to find the folder name matching this position.

Parameters

string $source: The source with optional group pattern.

Return value

int|null The determined group position.

1 call to IconFinder::determineGroupPosition()
IconFinder::getFilesFromPath in core/lib/Drupal/Core/Theme/Icon/IconFinder.php
Get files from a local path.

File

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

Class

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

Namespace

Drupal\Core\Theme\Icon

Code

private static function determineGroupPosition(string $source) : ?int {
    $parts = explode('/', trim($source, '/'));
    if ($result = array_search(self::GROUP_PATTERN, $parts, TRUE)) {
        return (int) $result;
    }
    return NULL;
}

API Navigation

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