class FilesystemLoader extends FilesystemLoader
FilesystemLoader extends the default Twig filesystem loader to work with the Symfony paths and template references.
protected | $locator | ||
protected | $parser |
__construct(FileLocatorInterface $locator, TemplateNameParserInterface $parser, string $rootPath = null) | ||
exists($name) {@inheritdoc} | ||
string | findTemplate(string|TemplateReferenceInterface $template, bool $throw = true) Returns the path to the template file. |
FileLocatorInterface | $locator | |
TemplateNameParserInterface | $parser | |
string | $rootPath |
{@inheritdoc}
The name parameter might also be a TemplateReferenceInterface.
$name |
Returns the path to the template file.
The file locator is used to locate the template when the naming convention is the symfony one (i.e. the name can be parsed). Otherwise the template is located using the locator from the twig library.
string|TemplateReferenceInterface | $template | The template |
bool | $throw | When true, a LoaderError exception will be thrown if a template could not be found |
string | The path to the template file |
LoaderError | if the template could not be found |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.html