FilesystemLoader
class FilesystemLoader extends FilesystemLoader
FilesystemLoader расширяет стандартный загрузчик Twig filesystem, чтобы работать с путями Symfony и ссылками на шаблоны.
Свойства
| protected | $locator | ||
| protected | $parser |
Методы
| __construct(FileLocatorInterface $locator, TemplateNameParserInterface $parser, string $rootPath = null) | ||
| exists($name) {@inheritdoc} | ||
| string | findTemplate(string|TemplateReferenceInterface $template, bool $throw = true) Возвращает путь к файлу шаблона. |
Подробности
__construct(FileLocatorInterface $locator, TemplateNameParserInterface $parser, string $rootPath = null)
Параметры
| FileLocatorInterface | $locator | |
| TemplateNameParserInterface | $parser | |
| string | $rootPath |
exists($name)
{@inheritdoc}
Параметр name также может быть объектом TemplateReferenceInterface.
Параметры
| $name |
protected string findTemplate(string|TemplateReferenceInterface $template, bool $throw = true)
Возвращает путь к файлу шаблона.
Локатор файлов используется для поиска шаблона, когда используется соглашение об именовании Symfony (т.е. имя может быть обработано). В противном случае шаблон находится с помощью локатора из библиотеки Twig.
Параметры
| string|TemplateReferenceInterface | $template | Шаблон |
| bool | $throw | При значении true, исключение LoaderError будет выброшено, если шаблон не найден |
Возвращаемое значение
| string | Путь к файлу шаблона |
Исключения
| LoaderError | если шаблон не найден |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.html