FileLocator

class FileLocator extends FileLocator

FileLocator uses the KernelInterface to locate resources in bundles.

Methods

__construct(KernelInterface $kernel, null|string $path = null, string|array $paths = array())

Constructor.

string|array locate($file, string|null $currentPath = null, bool $first = true)

Returns a full path for a given file name.

Details

__construct(KernelInterface $kernel, null|string $path = null, string|array $paths = array())

Constructor.

Parameters

KernelInterface $kernel A KernelInterface instance
null|string $path The path the global resource directory
string|array $paths A path or an array of paths where to look for resources

string|array locate($file, string|null $currentPath = null, bool $first = true)

Returns a full path for a given file name.

Parameters

$file
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

InvalidArgumentException When file is not found
doc_Symfony
2016-10-28 06:16:32
Comments
Leave a Comment

Please login to continue.