TemplateLocator
class TemplateLocator implements FileLocatorInterface
TemplateLocator locates templates in bundles.
Properties
protected |
$locator |
|
|
protected |
$cache |
|
|
Methods
Details
__construct(FileLocatorInterface $locator, string $cacheDir = null)
Parameters
protected string getCacheKey($template)
Returns a full path for a given file.
Parameters
Return Value
string |
The full path for the file |
string|array locate(TemplateReferenceInterface $template, string|null $currentPath = null, bool $first = true)
Returns a full path for a given file.
Parameters
TemplateReferenceInterface |
$template |
A template |
string|null |
$currentPath |
The current path |
bool |
$first |
Whether to return the first occurrence or an array of filenames |
Return Value
string|array |
The full path to the file or an array of file paths |
Exceptions