FlySystemLoader
in package
implements
LoaderInterface
Interfaces, Classes and Traits
- LoaderInterface
- Interface all loaders must implement.
Table of Contents
- $filesystem : FilesystemInterface
- $overloadPrefix : string|null
- $templatePath : string
- __construct() : mixed
- exists() : bool
- Check if we have the source code of a template, given its name.
- getCacheKey() : string
- Gets the cache key to use for the cache for a given template name.
- getSourceContext() : Source
- Returns the source context for a given template logical name.
- isFresh() : bool
- Returns true if the template is still fresh.
- guardTemplateExistsAndIsFile() : void
- resolveTemplateName() : string
Properties
$filesystem
private
FilesystemInterface
$filesystem
$overloadPrefix
private
string|null
$overloadPrefix
prefix used to allow extends of base templates. For example
{% extends 'template::css/template.css.twig' %}
$templatePath
private
string
$templatePath
Methods
__construct()
public
__construct(FilesystemInterface $filesystem[, string $templatePath = '' ][, string|null $overloadPrefix = null ]) : mixed
Parameters
- $filesystem : FilesystemInterface
- $templatePath : string = ''
- $overloadPrefix : string|null = null
Return values
mixed —exists()
Check if we have the source code of a template, given its name.
public
exists(mixed $name) : bool
Parameters
- $name : mixed
-
The name of the template to check if we can load
Tags
Return values
bool —If the template source code is handled by this loader or not
getCacheKey()
Gets the cache key to use for the cache for a given template name.
public
getCacheKey(mixed $name) : string
Simple straightforward implementation that checks the existence of the template, and if it exists: returns the name to be used as a cache key.
Parameters
- $name : mixed
-
The name of the template to load
Tags
Return values
string —The cache key
getSourceContext()
Returns the source context for a given template logical name.
public
getSourceContext(mixed $name) : Source
Parameters
- $name : mixed
-
The template logical name
Tags
Return values
Source —isFresh()
Returns true if the template is still fresh.
public
isFresh(mixed $name, mixed $time) : bool
Parameters
- $name : mixed
-
The template name
- $time : mixed
-
Timestamp of the last modification time of the cached template
Tags
Return values
bool —true if the template is fresh, false otherwise
guardTemplateExistsAndIsFile()
private
guardTemplateExistsAndIsFile(string $name) : void
Parameters
- $name : string
Tags
Return values
void —resolveTemplateName()
private
resolveTemplateName(string $name) : string
Parameters
- $name : string