W3cubDocs

/Symfony 4.1

FilesystemLoader

class FilesystemLoader extends Loader

FilesystemLoader is a loader that read templates from the filesystem.

Properties

protected LoggerInterface|null $logger from Loader
protected $templatePathPatterns

Methods

setLogger(LoggerInterface $logger)

Sets the debug logger to use for this loader.

from Loader
__construct(string|string[] $templatePathPatterns)
Storage|bool load(TemplateReferenceInterface $template)

Loads a template.

bool isFresh(TemplateReferenceInterface $template, int $time)

Returns true if the template is still fresh.

static bool isAbsolutePath(string $file)

Returns true if the file is an existing absolute path.

Details

setLogger(LoggerInterface $logger)

Sets the debug logger to use for this loader.

Parameters

LoggerInterface $logger

__construct(string|string[] $templatePathPatterns)

Parameters

string|string[] $templatePathPatterns An array of path patterns to look for templates

Storage|bool load(TemplateReferenceInterface $template)

Loads a template.

Parameters

TemplateReferenceInterface $template

Return Value

Storage|bool false if the template cannot be loaded, a Storage instance otherwise

bool isFresh(TemplateReferenceInterface $template, int $time)

Returns true if the template is still fresh.

Parameters

TemplateReferenceInterface $template A template
int $time The last modification time of the cached template (timestamp)

Return Value

bool

static protected bool isAbsolutePath(string $file)

Returns true if the file is an existing absolute path.

Parameters

string $file A path

Return Value

bool true if the path exists and is absolute, false otherwise

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Templating/Loader/FilesystemLoader.html