option()
Shortcut for $kirby->option($key, $default)
option(string $key, mixed $default = null): mixed|null
Parameters
Name | Type | Default |
---|---|---|
$key * | string |
– |
$default | mixed |
null |
Return type
mixed
|null
Example
Fetch an option by key from the config:
$locale = option('locale', 'en');
Custom option
$myCustomOption = option('customOption');