W3cubDocs

/CakePHP 4.4

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

  • get() public

    Read a configuration key

  • has() public

    Check if $path exists and has a non-null value.

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

mixed

has() public

has(string $path): bool

Check if $path exists and has a non-null value.

Parameters

string $path

The path to check.

Returns

bool

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.Core.ServiceConfig.html