PHPackages                             fg/config-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. fg/config-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

fg/config-bundle
================

Settings from db

07PHP

Since Aug 15Pushed 10y ago1 watchersCompare

[ Source](https://github.com/fg/FgConfigBundle)[ Packagist](https://packagist.org/packages/fg/config-bundle)[ RSS](/packages/fg-config-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

FgConfigBundle
--------------

[](#fgconfigbundle)

This bundle helps you to store your settings for application layer. This settings are stored based on scope such as general, user groups, user and can be accessedfrom any layer later.

An example:

Let say we have 30 quota available for Math class:

```
{
    "id": 1,
    "scope_group_type": "labs",
    "scope_by_id": 2,
    "section": "registration",
    "name": "quota",
    "value": 30,
    "created_at" : "2015-08-13 00:00:00",
    "updated_at" : "2015-08-13 00:00:00"
}
```

1. Installation

---

#### 1.1 Install Repository

[](#11-install-repository)

You can install via [composer](http://getcomposer.org/download/).

```
composer require fg/config-bundle
```

or add to require section of `composer.json:`

```
"fg/config-bundle": "dev-master"
```

#### 1.2 Enable Bundle in app/AppKernel.php

[](#12-enable-bundle-in-appappkernelphp)

```
public function registerBundles() {
    $bundles = array(
        // ...
        new Fg\Bundle\ConfigBundle\FgConfigBundle()
    );
    // ...
}
```

#### 1.3 Run migration

[](#13-run-migration)

```
php app/console doctrine:schema:update --force
```

2. Usage

---

### 2.1 Creating a ne setting

[](#21-creating-a-ne-setting)

There are three different ways to create a new setting.

#### 2.1.1 By using Command Line Interface (CLI)

[](#211-by-using-command-line-interface-cli)

You can create a new setting by runnig `php app/console fg:config:create` command from cli.

#### 2.1.2 By calling create method of SettingService

[](#212-by-calling-create-method-of-settingservice)

You can create a new setting by calling the create method of `SettingService` which previously passed to service container.

```
$settingService = $this->get('fg_config.service.setting_service');
#create($name, $value, $scopeGroupType, $section, $scopeById = 0)
$setting = $settingService->create('test', 'test', 'general', 'general')
```

#### 2.1.3 By using web user interface

[](#213-by-using-web-user-interface)

`http://localhost/path/to/management/setting`

### 2.2 Accessing

[](#22-accessing)

#### 2.2.1 Accessing from controller layer

[](#221-accessing-from-controller-layer)

```
...
$settingService = $this->get('fg_config.service.setting_service');
$settingObject  = $settingService->getAllSettingByScope('quota', 'labs', 'registration', 2);
...
```

#### 2.2.2 Accessing from Twig

[](#222-accessing-from-twig)

```
...
{{ get_setting('phone') }} //get setting object of name phone
{{ get_setting_value('phone') }} //get value of name phone
...
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/050ba9ef94cf1005f32953ebcd8f9a77b171950fd99e726bd23b29bba580306b?d=identicon)[fgursoy34](/maintainers/fgursoy34)

---

Top Contributors

[![fg](https://avatars.githubusercontent.com/u/2738851?v=4)](https://github.com/fg "fg (2 commits)")

### Embed Badge

![Health badge](/badges/fg-config-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/fg-config-bundle/health.svg)](https://phpackages.com/packages/fg-config-bundle)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
