library application-config-service-provider
This is a Silex ServiceProvider to use yaml configuration files.
kohkimakimoto/application-config-service-provider
This is a Silex ServiceProvider to use yaml configuration files.
- Monday, July 1, 2013
- by kohkimakimoto
- Repository
- 1 Watchers
- 1 Stars
- 33 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
ApplicationConfigServiceProvider
, (*1)
This is a Silex ServiceProvider to use yaml configuration files., (*2)
Synopsis
``` yaml, (*3)
config.yml
param: AAA
param2: BBB
param3:
param3-1: aaa
param3-2: aaa, (*4)
``` php
// something.php
use Silex\Application;
use Kohkimakimoto\Silex\Provider\ApplicationConfigServiceProvider;
$app = new Application();
$app->register(new ApplicationConfigServiceProvider(), array(
'config.path' => __DIR__.'config.yml'
));
$app['config']->get('param'); # AAA
$app['config']->get('param4'); # null
$app['config']->get('param4', "default"); # default
$app['config']->get('param3'); # array('param3-1' => 'aaa', 'param3-2' => 'aaa')
$app['config']->get('param3/param3-1', null, '/'); # aaa