PHPackages                             kunicmarko/simple-configuration-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kunicmarko/simple-configuration-bundle

AbandonedArchivedSymfony-bundle[Utility &amp; Helpers](/categories/utility)

kunicmarko/simple-configuration-bundle
======================================

This is a Symfony Bundle that adds key value storage to your Sonata admin.

v1.0.2(8y ago)58MITPHPPHP ^7.1

Since Oct 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/kunicmarko20/SimpleConfigurationBundle)[ Packagist](https://packagist.org/packages/kunicmarko/simple-configuration-bundle)[ Docs](https://github.com/kunicmarko20/simple-configuration-bundle)[ RSS](/packages/kunicmarko-simple-configuration-bundle/feed)WikiDiscussions v1.x Synced yesterday

READMEChangelog (3)Dependencies (5)Versions (5)Used By (0)

Simple Configuration Bundle
===========================

[](#simple-configuration-bundle)

[![Build Status](https://camo.githubusercontent.com/6d72476e87155be9888def014507e48533799be43e08810d66d047374c051d77/68747470733a2f2f7472617669732d63692e6f72672f6b756e69636d61726b6f32302f53696d706c65436f6e66696775726174696f6e42756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/kunicmarko20/SimpleConfigurationBundle)[![SensioLabsInsight](https://camo.githubusercontent.com/3d44a082773070891afe1b936713a73e9392a6e11f8bfa409664b936f19e0738/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f34623963353131642d336130392d343432652d623838322d6462376461363633626631312f6d696e692e706e67)](https://insight.sensiolabs.com/projects/4b9c511d-3a09-442e-b882-db7da663bf11)[![StyleCI](https://camo.githubusercontent.com/4fa9177f6621defb28b38295eea931b71d5379d0f7fc98c4491fed86f4206593/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130383537313134312f736869656c64)](https://styleci.io/repos/108571141)[![Coverage Status](https://camo.githubusercontent.com/e8ff2c96876107d74de32ea8dea7a4807b180fe99fcaeef5049b321cfb2d60a8/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6b756e69636d61726b6f32302f53696d706c65436f6e66696775726174696f6e42756e646c652f62616467652e737667)](https://coveralls.io/github/kunicmarko20/SimpleConfigurationBundle)

This bundle adds key:value storage to your sonata admin, also you can easily extend bundle and add your own types.

This bundle depends on [SonataAdminBundle](https://github.com/sonata-project/SonataAdminBundle)

[![Dashboard](https://cloud.githubusercontent.com/assets/13528674/21304601/a1c4936e-c5c6-11e6-9834-2d9f9942c5ff.png)](https://cloud.githubusercontent.com/assets/13528674/21304601/a1c4936e-c5c6-11e6-9834-2d9f9942c5ff.png)Documentation
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#documentation)

- [Installation](#installation)
- [How to use](#how-to-use)
- [Add new type](#add-new-type)
- [Roles and Categories](#roles-and-categories)
- [Additional stuff](#additional-stuff)

Installation
------------

[](#installation)

**1.** Add to composer.json to the `require` key

```
composer require kunicmarko/simple-configuration-bundle

```

**2.** Register the bundle in `app/AppKernel.php`

```
$bundles = array(
    // ...
    new KunicMarko\SimpleConfigurationBundle\SimpleConfigurationBundle(),
);

```

If you are not using auto\_mapping add it to your orm mappings

```
# app/config/config.yml
   orm:
        entity_managers:
            default:
                mappings:
                    AppBundle: ~
                    ...
                    SimpleConfigurationBundle: ~

```

**3.** Update database

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

```

**4.** Clear cache

```
app/console cache:clear

```

How to use
----------

[](#how-to-use)

In your twig template you can call it like :

```
{{ simple_configuration.getAll() }}
{{ simple_configuration.getValueFor('name') }}

```

if you want to use it in controller you can do :

```
$this->get('simple_configuration.service.configuration')->getAll()
$this->get('simple_configuration.service.configuration')->getValueFor('name')

```

Add new type
------------

[](#add-new-type)

If you want to add new types, you can do it like this

```
# app/config/config.yml

simple_configuration:
    types:
        newtype: YourBundle\Entity\NewType

```

### Creating new Type

[](#creating-new-type)

Your new type has to extend AbstractConfigurationType, you also have to specify template used for sonata list (it can be sonata template, or your own created), and how should field be rendered in form.

**1.** New type without new column

```
namespace YourBundle\Entity;

use KunicMarko\SimpleConfigurationBundle\Entity\AbstractConfigurationType;
use Sonata\AdminBundle\Form\FormMapper;
use Symfony\Component\Form\Extension\Core\Type\TextType;

class NewType extends AbstractConfigurationType
{
    /**
     * {@inheritDoc}
     */
    public function getTemplate() : string
    {
        return 'SonataAdminBundle:CRUD:list_string.html.twig';
    }

    /**
     * {@inheritDoc}
     */
    public function generateFormField(FormMapper $formMapper) : void
    {
        $formMapper->add('value', TextType::class, ['required' => false]);
    }
}

```

**2.** New type with new column

As you can see from example code below, we added new `$date` field, the one thing that is necessary is to overwrite `getValue()` method with delegating to your getter for new field as shown below.

```

namespace YourBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use KunicMarko\SimpleConfigurationBundle\Entity\AbstractConfigurationType;
use Sonata\AdminBundle\Form\FormMapper;
use Symfony\Component\Form\Extension\Core\Type\DateType;

class NewType extends AbstractConfigurationType
{
    /**
     * @var \DateTime
     *
     * @ORM\Column(name="date", type="date", nullable=true)
     */
    private $date;

    public function setDate(?\DateTime $date) : self
    {
        $this->date = $date;

        return $this;
    }

    public function getDate() : ?\DateTime
    {
        return $this->date;
    }

    public function getValue() : ?\DateTime
    {
        return $this->getDate();
    }

    /**
     * {@inheritDoc}
     */
    public function getTemplate() : string
    {
        //return 'SonataAdminBundle:CRUD:list_string.html.twig'; can also be used

        return 'SimpleConfigurationBundle:CRUD:list_field_date.html.twig';
    }

    /**
     * {@inheritDoc}
     */
    public function generateFormField(FormMapper $formMapper) : void
    {
        $formMapper->add('date', DateType::class, ['required' => false]);
    }
}

```

Do not forget to update database after adding new field :

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

```

Additional stuff
----------------

[](#additional-stuff)

When including this bundle you get access to some twig filters I needed.

### Elapsed

[](#elapsed)

In twig you can use `|elapsed` filter and you will get human readable time, it works with timestamps or DateTime objects.

```
{{ var|elapsed }}

#outputs "time" ago, 5 days ago, 5 minutes ago, just now, 1 month ago, etc.

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 90.5% 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.

###  Release Activity

Cadence

Every ~8 days

Total

4

Last Release

3092d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c1e666a733b6e07ad9507caffe4fb9ddbf91f9f2676bafd4845bc56cfdbe892?d=identicon)[kunicmarko20](/maintainers/kunicmarko20)

---

Top Contributors

[![kunicmarko20](https://avatars.githubusercontent.com/u/13528674?v=4)](https://github.com/kunicmarko20 "kunicmarko20 (19 commits)")[![jonthorne](https://avatars.githubusercontent.com/u/29188922?v=4)](https://github.com/jonthorne "jonthorne (2 commits)")

---

Tags

configuration-managementkey-valuesonata-adminsymfony-bundlesymfonybundlesonata-adminsonatakey value storage

### Embed Badge

![Health badge](/badges/kunicmarko-simple-configuration-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/kunicmarko-simple-configuration-bundle/health.svg)](https://phpackages.com/packages/kunicmarko-simple-configuration-bundle)
```

PHPackages © 2026

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