Documentation
- Installation
- Controller
- Views
- Database access
- Modules
- Autoloading
- Config management
- Localization
- Logging
- Environment
- Helpers
- Exceptions
- CLI interface
- Events
- Commands
- Authentication
- Caching
- Testing
- mail() wrapper
- SMTP mailer
- HTML helpers
- npm/webpack
Config management
The framework offers the possibility to load configuration data from config scripts from the app/config directory.
For instance you can have the config file app/config/test.php with the following content:
<?php
return [
'attr' => 'value',
'more' => [
//More data
]
];
You can now query the config data like this:
<?php
$data = config('test'); //Loads data from app/config/test.php
$attr = $data->attr;
If the config script returns an array then it is returned as object by default. In order to turn off this behaviour and return the array instead, simply pass ‚false‘ as second argument.
<?php
$data = config('test', false);
$attr = $data['attr'];
```php