it-blaster / config-bundle
Symfony2 扩展包,为 Sonata 添加配置列表
v1.0.2
2015-06-17 07:17 UTC
Requires
- egeloen/ckeditor-bundle: >=2.0
- it-blaster/translation-bundle: >=1.0.0
- propel/propel-bundle: >=1.0
- sonata-project/propel-admin-bundle: >=1.0
- symfony/symfony: >=2.2
This package is not auto-updated.
Last update: 2024-09-14 17:48:10 UTC
README
安装
将包添加到 composer.json
并安装
{ "require": { "it-blaster/config-bundle": "dev-master" }, }
将扩展包添加到 AppKernel.php
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new ItBlaster\ConfigBundle\ItBlasterConfigBundle(), ); }
构建模型
$ php app/console propel:build
用法
在需要的地方使用 get
方法
$value = Config::get('config_key', $request->getLocale());
Twig 函数
{{ config('social_twitter_link', app.request.locale) }}