Skip to content

Kirby 4.4.1

$kirby->option()

Load a specific configuration option

$kirby->option(string $key, mixed $default = null): mixed|null

Parameters

Name Type Default
$key * string
$default mixed null

Return type

mixed|null

Parent class

Kirby\Cms\App

Example

site/config/config.php
return [
    'my' => [
        'option' => 'foo'
    ]
];
$kirby->option('my.option') // 'foo'
$kirby->option('another.option', 'my fallback') // 'my fallback'