Spec-Zone.ru › Symfony 4.1

TemplateLocator

class TemplateLocator implements FileLocatorInterface

TemplateLocator находит шаблоны в пакетах.

Свойства

protected $locator
protected $cache

Методы

__construct(FileLocatorInterface $locator, string $cacheDir = null)
string getCacheKey($template)

Возвращает полный путь к заданному файлу.

string|array locate(TemplateReferenceInterface $template, string|null $currentPath = null, bool $first = true)

Возвращает полный путь к заданному файлу.

Подробности

__construct(FileLocatorInterface $locator, string $cacheDir = null)

Параметры

FileLocatorInterface $locator Экземпляр FileLocatorInterface
string $cacheDir Путь к кешу

protected string getCacheKey($template)

Возвращает полный путь к заданному файлу.

Параметры

$template

Возвращаемое значение

string Полный путь к файлу

string|array locate(TemplateReferenceInterface $template, string|null $currentPath = null, bool $first = true)

Возвращает полный путь к заданному файлу.

Параметры

TemplateReferenceInterface $template Шаблон
string|null $currentPath Текущий путь
bool $first Возвращать первое вхождение или массив имён файлов

Возвращаемое значение

string|array Полный путь к файлу или массив путей к файлам

Исключения

InvalidArgumentException При ошибке невалидного типа шаблона
InvalidArgumentException При ошибке отсутствия шаблона файла

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

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API