TemplateLoader

Type
Class
Namespace
craft\web\twig
Inherits
craft\web\twig\TemplateLoader
Implements
Twig\Loader\ExistsLoaderInterface, Twig\Loader\LoaderInterface

View source (opens new window)

# Protected Properties

# view

Type
craft\web\View, null (opens new window)
Default value
null

View source (opens new window)

# Public Methods

Method Description
__construct() Constructor
exists()
getCacheKey() Gets the cache key to use for the cache for a given template.
getSourceContext()
isFresh() Returns whether the cached template is still up to date with the latest template.

# __construct()

Constructor

View source (opens new window)

Arguments

# exists()

View source (opens new window)

Arguments

  • $name

# getCacheKey()

Gets the cache key to use for the cache for a given template.

View source (opens new window)

Arguments

Returns

string (opens new window) – The cache key (the path to the template)

Throws

# getSourceContext()

View source (opens new window)

Arguments

  • $name

# isFresh()

Returns whether the cached template is still up to date with the latest template.

View source (opens new window)

Arguments

Returns

boolean (opens new window)

Throws