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

Breadcrumb

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

function IconFinder::getFileContents

Overrides IconFinderInterface::getFileContents

File

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

Class

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

Namespace

Drupal\Core\Theme\Icon

Code

public function getFileContents(string $uri) : string|bool {
    $url = parse_url($uri);
    if (isset($url['scheme']) || isset($url['host'])) {
        return FALSE;
    }
    if (!file_exists($uri)) {
        return FALSE;
    }
    return file_get_contents($uri);
}

API Navigation

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