ready
Inject last minute configuration options
The ready
option accepts a callback and makes it possible to inject last minute configurations. The callback is executed when Kirby's instance is ready to be fully used and you can use all roots, urls and other stuff from Kirby to set additional options accordingly.
Examples
<?php
return [
'ready' => function() {
return [
'my.option' => kirby()->root('index') . '/resources'
];
}
];
<?php
return [
'ready' => function ($kirby) {
return [
'db' => [
'database' => $kirby->root('site') . '/db/database.sqlite',
'type' => 'sqlite'
]
];
}
];
<?php
return [
'ready' => function ($kirby) {
return [
'debug' => $kirby->user() !== null
];
}
];