wilkques / config
Installs: 136
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/wilkques/config
Requires
- php: >=5.3
- wilkques/container: *
- wilkques/filesystem: *
- wilkques/php-helper: *
Requires (Dev)
Suggests
- ext-yaml: Required to use the YAML output option
README
composer require wilkques/config
How to use
-
Add PHP config file (path default
./Config
)<?php return [ 'abc' => 'efg', ];
Or json
{ "abc": "efg", }
Or yaml
※need php yaml extensionabc: efg: "hij"
-
Add PHP code in file
require_once 'vendor/autoload.php'; config() //->setPath('<config/path>') custom config path ->boot(); $config = config('<key>'); // get config item $config->setItem('<key>', '<value>'); // set config item $config->withConfig([ '<key>' => '<value>' // set config with array ]); $config->getItem('<key>'); // get config item $config->all(); // get config all items