poznet/configbundle

Simple Configuration Handling in SF2

v1.2.2 2019-11-02 19:21 UTC

This package is auto-updated.

Last update: 2024-04-29 03:07:16 UTC


README

Simple Configuration handling in SF

SensioLabsInsight

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.