Get the namespace used in the given .php or .module file
Usage
// basic usage
$string = $files->getNamespace(string $file);
// usage with all arguments
$string = $files->getNamespace(string $file, bool $fileIsContents = false);
Arguments
Name | Type(s) | Description |
---|---|---|
file | string | File name or file data (if file data, specify true for 2nd argument) |
fileIsContents (optional) | bool | Specify true if the given $file is actually the contents of the file, rather than file name. |
Return value
string
Actual found namespace or "\" (root namespace) if none found
API reference based on ProcessWire core version 3.0.236