Class ServiceConfig
Read-only wrapper for configuration data
Intended for use with {@link \Cake\Core\Container} as a typehintable way for services to have application configuration injected as arrays cannot be typehinted.
Namespace: Cake\Core
Method Summary
Method Detail
get() ¶ public
get(string $path, mixed $default = null): mixed
Read a configuration key
Parameters
-
string$path The path to read.
-
mixed$default optional The default value to use if $path does not exist.
Returns
mixedThe configuration data or $default value.
has() ¶ public
has(string $path): bool
Check if $path exists and has a non-null value.
Parameters
-
string$path The path to check.
Returns
boolTrue if the configuration data exists.