Spec-Zone.ru › Symfony 3.0

Локатор шаблонов

класс TemplateLocator реализует 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.0/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.html

Spec-Zone.ru

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