ConfigBundle
Simple Configuration handling in SF, (*1)
, (*2)
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., (*3)
So based on WP/Presta experience i creates simple service to store some data., (*4)
Data are serializaed and stored in db., (*5)
Instalation
Use composer require poznet/ConfigBundle, (*6)
Usage
Simple:, (*7)
$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. ), (*8)
To retrive data use:, (*9)
$x=$this->get('configuration')->get('foo');, (*10)
Uasge with saveing config for multile objects, (*11)
$this->get('configuration')->setFor('foo','objectName','bar');, (*12)
To retrive data for object use:, (*13)
$x=$this->get('configuration')->get('foo','objectName');, (*14)
Licence
This Bundle is licensed under the MIT License. Feel free to contribute., (*15)