Symfony2 API
Class

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, Boolean $first = true)

Returns a full path for a given file name.

Details

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

Constructor.

Parameters

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

at line 66
public string locate(TemplateReferenceInterface $template, string $currentPath = null, Boolean $first = true)

Returns a full path for a given file name.

Parameters

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

Return Value

string The full path for the file

Exceptions

InvalidArgumentException When file is not found