class ThemeRegistryLoader extends FilesystemLoader (View source)

Loads templates based on information from the Drupal theme registry.

Allows for template inheritance based on the currently active template.

Properties

protected Registry $themeRegistry

The theme registry used to determine which template to use.

Methods

__construct(Registry $theme_registry)

Constructs a new ThemeRegistryLoader object.

string|false
findTemplate(string $name, bool $throw = TRUE)

Finds the path to the requested template.

getCacheKey($name)

{@inheritdoc}

Details

__construct(Registry $theme_registry)

Constructs a new ThemeRegistryLoader object.

Parameters

Registry $theme_registry

The theme registry.

protected string|false findTemplate(string $name, bool $throw = TRUE)

Finds the path to the requested template.

Parameters

string $name

The name of the template to load.

bool $throw

Whether to throw an exception when an error occurs.

Return Value

string|false

The path to the template, or false if the template is not found.

Exceptions

LoaderError

getCacheKey($name)

{@inheritdoc}

Parameters

$name