FileLocator
extends FileLocator
in package
FileLocator uses the KernelInterface to locate resources in bundles.
Tags
Table of Contents
- $paths : mixed
- $kernel : mixed
- __construct() : mixed
- locate() : string|array<string|int, mixed>
- Returns a full path for a given file name.
- isAbsolutePath() : bool
- Returns whether the file path is an absolute path.
Properties
$paths
protected
mixed
$paths
$kernel
private
mixed
$kernel
Methods
__construct()
public
__construct(KernelInterface $kernel) : mixed
Parameters
- $kernel : KernelInterface
Return values
mixed —locate()
Returns a full path for a given file name.
public
locate(string $file[, string|null $currentPath = null ][, bool $first = true ]) : string|array<string|int, mixed>
Parameters
- $file : string
- $currentPath : string|null = null
-
The current path
- $first : bool = true
-
Whether to return the first occurrence or an array of filenames
Return values
string|array<string|int, mixed> —The full path to the file or an array of file paths
isAbsolutePath()
Returns whether the file path is an absolute path.
private
isAbsolutePath(string $file) : bool
Parameters
- $file : string