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

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

yiithings/yii2-setting
======================

Site setting extension

190PHP

Since Jan 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/yiithings/yii2-setting)[ Packagist](https://packagist.org/packages/yiithings/yii2-setting)[ RSS](/packages/yiithings-yii2-setting/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#yii2-setting)

[![Build Status](https://camo.githubusercontent.com/47a7e4852fa8f6c0302fe1c0b7af6935f47f6e180c60be625efb3caca5ecbb13/68747470733a2f2f7472617669732d63692e6f72672f7969697468696e67732f796969322d73657474696e672e737667)](https://travis-ci.org/yiithings/yii2-setting)[![Latest Stable Version](https://camo.githubusercontent.com/7eda13f5f38236899418afcc09790cba673d51d71a93160308af73a8b949ff49/68747470733a2f2f706f7365722e707567782e6f72672f7969697468696e67732f796969322d73657474696e672f762f737461626c652e737667)](https://packagist.org/packages/yiithings/yii2-setting)[![Total Downloads](https://camo.githubusercontent.com/c996c2d34ca98de080e670f8b0aba27e3a512165a9cefca45562b8129dd17423/68747470733a2f2f706f7365722e707567782e6f72672f7969697468696e67732f796969322d73657474696e672f646f776e6c6f6164732e737667)](https://packagist.org/packages/yiithings/yii2-setting)[![Latest Unstable Version](https://camo.githubusercontent.com/c40d512bd59d9be168d181da5273e8041b5b41a006197d864a3cd612676dba08/68747470733a2f2f706f7365722e707567782e6f72672f7969697468696e67732f796969322d73657474696e672f762f756e737461626c652e737667)](https://packagist.org/packages/yiithings/yii2-setting)[![License](https://camo.githubusercontent.com/14e1f5f4507ee448cd9319aebea74b017dd82b569c1927b356b733f920451c9f/68747470733a2f2f706f7365722e707567782e6f72672f7969697468696e67732f796969322d73657474696e672f6c6963656e73652e737667)](https://packagist.org/packages/yiithings/yii2-setting)

It helps you to dynamically construct, validate, and display setting variables in the Yii2 framework.

Supports `Bootstrap`(default), `AdminLTE` and `Gentelella Alela!`.

What's This
-----------

[](#whats-this)

Yii2 Setting 是一个通用型的 `设置` 拓展，可以为 Yii2 应用提供开箱即用的定制、操作和显示配置项的功能。它可以帮助你动态的构造配置项， 并将设置的验证规则，数据处理方式等拓展信息保存在数据库。它的配置页面预置支持 `Bootstrap`、, `AdminLTE` 和 `Gentelella Alela!` ， 同时提供了命令行工具、 Gii 生成工具以及设置项迁移工具。

一个理想的使用情景是，开发者在本地开发环境使用命令行或者页面生成工具创建需要的设置项，配置设置项规则， 然后使用迁移工具 ( Migration ) 将设置迁移至指定的线上环境。

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist yiithings/yii2-setting "*"

```

or add

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

```

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

Usage
-----

[](#usage)

拓展分为包含 `yiithings\setting\Setting` 组件和 `yiithings\setting\Module` 模块，`yiithings\setting\Setting` 组件是必须的， 是对配置项进行 CRUD 的统一入口。`yiithings\setting\Module` 模块是可选的，提供了 Web 端配置页面与控制台命令行，并会设置一些所需属性。 通常，我们将组件 ID 设置为 `setting`，将模块 ID 设置为 `settings`。

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

```
'components' => [、
    'setting' => [
        'class' => 'yiithings\setting\Setting',
    ]
],
'modules' => [
    'settings' => [
        'class' => 'yiithings\setting\Module',
    ]
],
```

> 组件 API 参见 [Setting Class](src/Setting.php)

模块页面对 `AdminLTE` 和 `Gentelella Alela!` 两种主题提供了主题化定制（默认为`Bootstrap`）。如果你的应用使用了这两种主题中的一个， 可以通过配置 `theme` 属性来设置主题。

```
'modules' => [
    'settings' => [
        'class' => 'yiithings\setting\Module',
        'theme' => 'gentelella',
    ]
],
```

模块使用了 I18N 组件并且预置了一些语言的翻译。如果预置翻译没有你所需要的语言或不能满足要求，可自行添加翻译。拓展使用了 `yiithings/setting` 作为消息分类名。

```
[
    'i18n' => [
        'translations' => [
            'yiithings/setting' => [
               'class'          => 'yii\i18n\PhpMessageSource',
               'sourceLanguage' => 'en',
               'basePath'       => 'YOU_PATH',
               'fileMap'        => [
                   'yiithings/setting' => 'YOU_PATH',
               ],
           ]
        ]
    ]
]
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

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/c79a4220751bab4ff8ee0953a41c4664fddb12e2a47e69442c2e5315b5c7ef9a?d=identicon)[panlatent](/maintainers/panlatent)

---

Top Contributors

[![panlatent](https://avatars.githubusercontent.com/u/4393268?v=4)](https://github.com/panlatent "panlatent (33 commits)")

---

Tags

settingsyii2-extensionyii2-frameworkyii2-settings

### Embed Badge

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

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

###  Alternatives

[elliottb/phpgraphlib

PHP Graphing Library that creates graphs natively in PHP

9013.1k](/packages/elliottb-phpgraphlib)

PHPackages © 2026

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