A Resource can be a file or a directory.
The resource name must follow the following pattern:
@/path/to/a/file.something
where BundleName is the name of the bundle
and the remaining part is the relative path in the bundle.
If $dir is passed, and the first segment of the path is "Resources",
this method will look for a file named:
$dir//path/without/Resources
before looking in the bundle resource folder.
public locateResource ( string $name, string $dir = null, boolean $first = true ) : string | array | ||
$name | string | A resource name to locate |
$dir | string | A directory where to look for the resource first |
$first | boolean | Whether to return the first path or paths for all matching bundles |
Résultat | string | array | The absolute path of the resource or an array if $first is false |