aamant / config-bundle
Symfony ConfigBundle
0.0.1
2017-04-17 09:40 UTC
Requires
- php: >=5.6.0
- symfony/form: ^2.8 || ^3.0
- symfony/framework-bundle: ^2.8 || ^3.0
- symfony/security-bundle: ^2.8 || ^3.0
- symfony/templating: ^2.8 || ^3.0
- symfony/twig-bundle: ^2.8 || ^3.0
- twig/twig: ^1.28 || ^2.0
Requires (Dev)
- phpunit/phpunit: ^6
This package is not auto-updated.
Last update: 2024-12-08 03:57:21 UTC
README
Install
Install with composer
composer require aamant/config-bundle
Modify AppKernel.php
$bundles = [
...
new Aamant\ConfigBundle\AamantConfigBundle(),
...
];
Add routes
aamant_config_config:
prefix: /config
resource: "@AamantConfigBundle/Resources/config/routing.xml"
Use service
$service = $this->getContainer()->get('aamant_config.config');
Use add, get, has, delete
$config->set('version', '0.0.1')
// hidden attribute
$config->set('version', '0.0.1', true)
// get
$config->get('version')
// has
$config->has('version')
// delete
$config->delete('version')
Translate
use config
domain for translate name of the attribute
Manage attributes values
http://my-app/app_dev.php/config