poznet / configbundle
Simple Configuration Handling in SF2
Requires
- php: >=5.3
README
Simple Configuration handling in SF
Idea
Idea is really simple, doing anything with symfony you need very often to save some config data. Parameters.yml are good , but it's problematic to save item to them from application level.
So based on WP/Presta experience i creates simple service to store some data.
Data are serializaed and stored in db.
Instalation
Use composer require poznet/ConfigBundle
Usage
Simple:
$this->get('configuration')->set('foo','bar');
- saves 'bar' string in configuration with key 'foo'.Also you can save any type od data (variables, classes etc. )
To retrive data use:
$x=$this->get('configuration')->get('foo');
Uasge with saveing config for multile objects
$this->get('configuration')->setFor('foo','objectName','bar');
To retrive data for object use:
$x=$this->get('configuration')->get('foo','objectName');
Licence
This Bundle is licensed under the MIT License. Feel free to contribute.