Templating\Loader\TemplateLocator (Bundle\FrameworkBundle)

Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator

class TemplateLocator implements FileLocatorInterface

TemplateLocator locates templates in bundles.

Methods

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

Constructor.

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

Returns a full path for a given file.

Details

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

Constructor.

Parameters

FileLocatorInterface $locator A FileLocatorInterface instance
string $cacheDir The cache path

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

Returns a full path for a given file.

Parameters

TemplateReferenceInterface $template A template
string $currentPath Unused
bool $first Unused

Return Value

string The full path for the file

Exceptions

InvalidArgumentException When the template is not an instance of TemplateReferenceInterface
InvalidArgumentException When the template file can not be found

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部