PHPackages                             phuongdev89/yii2-setting - 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. phuongdev89/yii2-setting

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

phuongdev89/yii2-setting
========================

Yii2 Setting for other application

0132PHP

Since Sep 18Pushed 1y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 Setting
============

[](#yii2-setting)

Yii2 Setting for other application

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

[](#installation)

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

Either run

```
php composer.phar require phuongdev89/yii2-setting "*"

```

or add

```
"phuongdev89/yii2-setting": "*"

```

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

Usage
-----

[](#usage)

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

### Migration

[](#migration)

Migration run

```
yii migrate --migrationPath=@phuongdev89/setting/migrations
```

### Config /common/config/main.php to use Yii::$app-&gt;setting

[](#config-commonconfigmainphp-to-use-yiiapp-setting)

```
    'components' => [
        'setting' => [
            'class' => 'phuongdev89\setting\Setting',
        ],
    ],
```

### Config backend modules in backend/config/main.php to manage settings

[](#config-backend-modules-in-backendconfigmainphp-to-manage-settings)

```
    'modules'    => [
   		'setting'  => [
			'class'               => 'phuongdev89\setting\Module',
			'controllerNamespace' => 'phuongdev89\setting\controllers',
			'enableMultiLanguage' => false,//set true if phuongdev89/yii2-multi-language installed and want to translate setting
   		],
   		'gridview' => [
            'class' => '\kartik\grid\Module',
   		],
   		'roxymce'  => [
            'class' => '\phuongdev89\roxymce\Module',
   		],
    ],
```

### Config at backend

[](#config-at-backend)

backend : \####Attention:

- Store Range required if type in (select, multiselect, checkbox, radio), supported string with comma, json, callback function.
    Example:
    - String: 1,2,3 or A,bcd,ef
    - Json: {"0" : "abc", "1" : "def"}
    - Callback: app\\helpers\\ArrayHelper::getItems()
    Just create simple static function named `getItems` in `app\helpers\ArrayHelper`

```
namespace app\helpers;

class ArrayHeper {

   public static function getItems(){
       return [
           0     => "abc",
           1     => "def",
           "ghi" => 2,
       ];
   }

}

```

### Use Your Setting

[](#use-your-setting)

Once you set the value at the backend. Simply access your setting by the following code (auto-suggest code worked):

```
echo Yii::$app->setting->get('siteName');
echo Yii::$app->setting->siteName;
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

Top contributor holds 58.6% 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/b606411df0cf562fe1d77d5ee80c3ef2e2c34a06d93470a4127c8910132ba258?d=identicon)[phuongdev89](/maintainers/phuongdev89)

---

Top Contributors

[![itzen](https://avatars.githubusercontent.com/u/8614041?v=4)](https://github.com/itzen "itzen (17 commits)")[![funson86](https://avatars.githubusercontent.com/u/6244263?v=4)](https://github.com/funson86 "funson86 (10 commits)")[![pawelkania](https://avatars.githubusercontent.com/u/9013316?v=4)](https://github.com/pawelkania "pawelkania (1 commits)")[![phuongdev89](https://avatars.githubusercontent.com/u/7648033?v=4)](https://github.com/phuongdev89 "phuongdev89 (1 commits)")

### Embed Badge

![Health badge](/badges/phuongdev89-yii2-setting/health.svg)

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

###  Alternatives

[kaufmanndigital/gdpr-cookieconsent

A ready-to-run package, that integrates an advanced cookie consent banner into your Neos CMS site.

2540.7k](/packages/kaufmanndigital-gdpr-cookieconsent)[selective/transformer

A strictly typed array transformer with dot-access, fluent interface and filters.

3817.8k1](/packages/selective-transformer)[derhansen/sf_banners

Banner-Management Extension based on Extbase and Fluid. Loads banners asynchronously using JavaScript.

1144.5k](/packages/derhansen-sf-banners)[martin/wn-forms-plugin

Create easy (and almost magic) AJAX forms

212.3k](/packages/martin-wn-forms-plugin)

PHPackages © 2026

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