TemplateLocator
class TemplateLocator implements FileLocatorInterface
TemplateLocator находит шаблоны в пакетах.
Свойства
| protected | $locator | | |
| protected | $cache | | |
Методы
Подробности
__construct(FileLocatorInterface $locator, string $cacheDir = null)
Параметры
protected string
getCacheKey($template)
Возвращает полный путь к заданному файлу.
Параметры
Возвращаемое значение
| string | Полный путь к файлу |
string|array
locate(TemplateReferenceInterface $template, string|null $currentPath = null, bool $first = true)
Возвращает полный путь к заданному файлу.
Параметры
| TemplateReferenceInterface | $template | Шаблон |
| string|null | $currentPath | Текущий путь |
| bool | $first | Возвращать первое вхождение или массив имён файлов |
Возвращаемое значение
| string|array | Полный путь к файлу или массив путей к файлам |
Исключения