PHPackages                             sersid/yii2-config - 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. sersid/yii2-config

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

sersid/yii2-config
==================

Yii2 manage configuration from database

v1.0.3(11y ago)42.5k6BSD-3-ClausePHP

Since Nov 20Pushed 11y ago2 watchersCompare

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

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Yii2 Config
===========

[](#yii2-config)

Manage configuration from database

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

[](#installation)

### One

[](#one)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist sersid/yii2-config "*"
```

or add

```
"sersid/yii2-config": "*"

```

to the require section of your `composer.json` file.

### Two

[](#two)

Applying migrations

```
yii migrate --migrationPath=@vendor/sersid/yii2-config/migrations

```

### Three

[](#three)

```
$config = [
    ...
    'components' => [
        ...
        'config' => [
            'class' => 'sersid\config\components\Config',
            'coding' => '...', // json of serialize. Default 'json'
            'idConnection' => 'db', // The ID of the connection component
            'tableName' => '{{%config}}', //Config table name
            'idCache' => 'cache', // The ID of the cache component. Default null (no caching)
            'cacheKey' => 'config.component', // The key identifying the value to be cached
            'cacheDuration' => 360, // The number of seconds in which the cached value will expire. 0 means never expire. Default 0
        ],
    ]
];
```

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by :

#### Set

[](#set)

```
Yii::$app->config->set('foo', 'bar');
Yii::$app->config->set('foo', ['bar', 'baz']);
Yii::$app->config->set(['foo' => 'bar']);
```

#### Get

[](#get)

```
Yii::$app->config->get('zyx'); // null
Yii::$app->config->get('zyx', 'default'); // 'default'
Yii::$app->config->get('foo', 'default'); // 'bar'
Yii::$app->config->get(['foo' => 'default']);
```

#### Delete

[](#delete)

```
Yii::$app->config->delete('foo');
Yii::$app->config->deleteAll(); // delete all config
```

Uninstall
---------

[](#uninstall)

Applying migrations

```
yii migrate/down --migrationPath=@vendor/sersid/yii2-config/migrations

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~35 days

Total

4

Last Release

4091d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2066261?v=4)[Sersid](/maintainers/Sersid)[@Sersid](https://github.com/Sersid)

---

Top Contributors

[![Sersid](https://avatars.githubusercontent.com/u/2066261?v=4)](https://github.com/Sersid "Sersid (19 commits)")

---

Tags

configyii2extension

### Embed Badge

![Health badge](/badges/sersid-yii2-config/health.svg)

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

###  Alternatives

[lav45/yii2-settings

This extension helps you to easily store and retrieve data for your application.

1615.0k2](/packages/lav45-yii2-settings)[abhi1693/yii2-config

Yii2 manage configuration from database

1311.0k1](/packages/abhi1693-yii2-config)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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