sergiors/config-service-provider
最新稳定版本:2.0.0
Composer 安装命令:
composer require sergiors/config-service-provider
包简介
Load yaml, php, directory config to into your container
README 文档
README
Install
composer require sergiors/config-service-provider
How to use
Let's imagine you want to load the following yaml file:
imports: - { resource: config.yml } twig.options: debug: false db.options: driver: ~ host: ~ user: ~ password: ~ dbname: ~ routing.options: paths: %root_dir%/app/routing.yml
In your php file
use Sergiors\Silex\Provider\ConfigServiceProvider; $app->register(new ConfigServiceProvider(), [ 'config.filenames' => '%root_dir%/config/config_%env%.yml', 'config.replacements' => [ 'root_dir' => dirname(__DIR__) ] ]); $app['config.initializer']();
Now you can access $app['twig.options']['debug'] and others
License
MIT
统计信息
- 总下载量: 339
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-11-01