GithubHelp home page GithubHelp logo

millenc / settingsbundle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rvanlaak/settingsbundle

0.0 2.0 0.0 240 KB

Database centric Symfony2 configuration management bundle. Global and per-entity settings supported.

License: MIT License

PHP 98.71% HTML 1.29%

settingsbundle's Introduction

SettingsBundle

Bundle for storing configuration with Symfony in database using Doctrine2 ORM.

Build Status SensioLabsInsight

Features

  • Easy-to-use (Twig extension, container service)
  • Settings scopes per user, global or all
  • Settings validation by using the Symfony Form Component
  • 2 serialization mechanisms: PHP serialize() and JSON (+ you can write your own)
  • Settings caching (PSR-6)
  • Fast and extensible

Quick usage examples

Symfony controller:

// Global settings
$this->get('settings_manager')->set('name', 'foo');
$this->get('settings_manager')->get('name'); // returns 'foo'

// User settings
$this->get('settings_manager')->get('name', $user); // returns global 'foo'
$this->get('settings_manager')->set('name', 'bar', $user);
$this->get('settings_manager')->get('name', $user); // returns 'bar'

Twig template:

{# Global setting #}
{{ get_setting('some_setting') }} {# => 'value' #}

{# User setting #}
{{ get_setting('some_user_setting', app.user) }} {# => 'value' #}

See the general usage documentation for more examples.

Documentation

Changelog, Roadmap and contribution

Please, do not hesitate to report bugs or send pull requests. It will help to motivate me to support library better than anything else :)

See CHANGELOG.md for all major changes.

Upgrade from 1.0.*

Make sure to read the UPGRADE.md to successfully migrate your application.

License

The MIT License. For the full text of license, please, see LICENSE

settingsbundle's People

Contributors

atyz avatar dmishh avatar hason avatar nyholm avatar rvanlaak avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.