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

Breadcrumb

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

function FilesystemLoader::getSourceContext

Overrides LoaderInterface::getSourceContext

1 method overrides FilesystemLoader::getSourceContext()
HelpTopicTwigLoader::getSourceContext in core/modules/help/src/HelpTopicTwigLoader.php
Returns the source context for a given template logical name.

File

vendor/twig/twig/src/Loader/FilesystemLoader.php, line 127

Class

FilesystemLoader
Loads template from the filesystem.

Namespace

Twig\Loader

Code

public function getSourceContext(string $name) : Source {
    if (null === ($path = $this->findTemplate($name))) {
        return new Source('', $name, '');
    }
    return new Source(file_get_contents($path), $name, $path);
}

API Navigation

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