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

Breadcrumb

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

function IconFinder::getFilesFromSources

Overrides IconFinderInterface::getFilesFromSources

File

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

Class

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

Namespace

Drupal\Core\Theme\Icon

Code

public function getFilesFromSources(array $sources, string $relative_path) : array {
    $result = [];
    foreach ($sources as $source) {
        // Detect if source is path or remote, parse_url will have no scheme for
        // a path.
        $url = parse_url($source);
        if (isset($url['scheme']) && isset($url['path'])) {
            $result = array_merge($result, $this->getFileFromUrl($url['scheme'], $url['path'], $source));
            continue;
        }
        $result = array_merge($result, $this->getFilesFromPath($source, $relative_path));
    }
    return $result;
}

API Navigation

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