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

Breadcrumb

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

function ArrayLoader::getSourceContext

Overrides LoaderInterface::getSourceContext

File

vendor/twig/twig/src/Loader/ArrayLoader.php, line 44

Class

ArrayLoader
Loads a template from an array.

Namespace

Twig\Loader

Code

public function getSourceContext(string $name) : Source {
    if (!isset($this->templates[$name])) {
        throw new LoaderError(\sprintf('Template "%s" is not defined.', $name));
    }
    return new Source($this->templates[$name], $name);
}

API Navigation

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