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

Breadcrumb

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

function File::getContent

File

vendor/symfony/http-foundation/File/File.php, line 104

Class

File
A file in the file system.

Namespace

Symfony\Component\HttpFoundation\File

Code

public function getContent() : string {
    $content = file_get_contents($this->getPathname());
    if (false === $content) {
        throw new FileException(\sprintf('Could not get the content of the file "%s".', $this->getPathname()));
    }
    return $content;
}

API Navigation

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