Spec-Zone.ru › Symfony 2.7

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

класс 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/2.7/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.html

Spec-Zone.ru

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