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