PHPackages                             marsoltys/yii2-settings - 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. marsoltys/yii2-settings

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

marsoltys/yii2-settings
=======================

Cms Settings - http://www.yiiframework.com/extension/settings/ rewritten for Yii 2

1.0.1(10y ago)11323BSD-3-ClausePHP

Since Jan 18Pushed 10y ago2 watchersCompare

[ Source](https://github.com/soltmar/yii2-settings)[ Packagist](https://packagist.org/packages/marsoltys/yii2-settings)[ RSS](/packages/marsoltys-yii2-settings/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

\#Yii 2 Settings#

\##Instalation##

\###Composer###

```
composer require "marsoltys/yii2-settings:*"

```

\##Configuratoion## Add the component to the web.php config file components section:

```
#...
'settings' => [
            'class'            => 'marsoltys\yii2-settings\CmsSettings',
            'cacheComponentId' => 'cache',
            'cacheId'          => 'global_website_settings',
            'cacheTime'        => 84000,
            'tableName'        => '{{settings}}',
            'dbComponentId'    => 'db',
            'createTable'      => **true**,
            'dbEngine'         => 'InnoDB',
        ],
'cache' => [
    'class' => 'yii\caching\FileCache', // Or any other type of Cache
],
#...

```

\##Usage##

```
/*
* Set a database item:
* $itemName can be an associative array() in key=>value pairs  ($itemValue="" in this case)
*/
Yii::$app->settings->set($categoryName, $itemName, $itemValue, $toDatabase=true);

// Get a database item:
Yii::$app->settings->get($categoryName, $itemName);

// Get all items from a category:
Yii::$app->settings->get($categoryName);

// Delete a database item:
Yii::$app->settings->delete($categoryName, $itemName);

// Delete all items from a category:
Yii::$app->settings->delete($categoryName);

//Import items from a file:
$items=include('path/to/file.php');//returns an array() in key=>value pairs
Yii::$app->settings->set($categoryName, $items);

```

The component uses something like "lazy loading" for loading items within a category, meaning that the items from a category will be loaded when you request them first time. Beside this, at the end of the request, the items from that requested category are written to cache, so next time when you request them, they will be served from cache.

Note, the component is smart enough to know itself when a new item/category has been added and refresh the cache accordingly so you don't have to keep track of the items you add to database.

Basically, in most of the cases, the database will be hit only once, then all items will be served from cache, which means you will get a nice way to manage the project configuration without performance penalties.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

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 ~149 days

Total

2

Last Release

3666d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf5ce65fe44ca3e88017133fe380c61d5390d4c1ea48f205dab26816aab826bf?d=identicon)[soltmar](/maintainers/soltmar)

---

Top Contributors

[![soltmar](https://avatars.githubusercontent.com/u/14175459?v=4)](https://github.com/soltmar "soltmar (11 commits)")

---

Tags

Settingscmsyii2

### Embed Badge

![Health badge](/badges/marsoltys-yii2-settings/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[pheme/yii2-settings

Yii2 Database settings

149753.2k7](/packages/pheme-yii2-settings)

PHPackages © 2026

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