TemplateLocator
class TemplateLocator implements FileLocatorInterface
TemplateLocator определяет шаблоны в пакетах.
Методы
| __construct(FileLocatorInterface $locator, string $cacheDir = null) Конструктор. | ||
| string|array | locate(TemplateReferenceInterface $template, string|null $currentPath = null, bool $first = true) Возвращает полный путь к заданному файлу. |
Подробности
__construct(FileLocatorInterface $locator, string $cacheDir = null)
Конструктор.
Параметры
| FileLocatorInterface | $locator | Экземпляр FileLocatorInterface |
| string | $cacheDir | Путь к кешу |
string|array locate(TemplateReferenceInterface $template, string|null $currentPath = null, bool $first = true)
Возвращает полный путь к заданному файлу.
Параметры
| TemplateReferenceInterface | $template | Шаблон |
| string|null | $currentPath | Текущий путь |
| bool | $first | Возвратить первое вхождение или массив имён файлов |
Возвращаемое значение
| string|array | Полный путь к файлу или массив путей к файлам |
Исключения
| InvalidArgumentException | Если шаблон не является экземпляром TemplateReferenceInterface |
| InvalidArgumentException | Если файл шаблона не найден |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.1/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.html