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

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

hbhe/yii2-settings
==================

website key-value parameter settings module

112PHP

Since Oct 21Pushed 7y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Introduction
============

[](#introduction)

可能是最实用的网站参数模块
-------------

[](#可能是最实用的网站参数模块)

### 0. 安装

[](#0-安装)

```
composer require hbhe/yii2-settings

```

### 1. 创建表

[](#1-创建表)

php yii migrate/up --migrationPath=@hbhe/settings/migrations

### 2. 配置(main.php)

[](#2-配置mainphp)

```
'components' => [
    'ks' => [
        'class' => hbhe\settings\models\KeyStorage::class
    ],
    // ...
],

'modules' => [
    // main.php中配好此module后, 后台可通过此地址直接查看key-value列表, http://127.0.0.1/yii2-adminlte/backend/web/settings/key-storage/index (一般测试时才配置此module)
    'ks' => [
        'class' => 'hbhe\settings\Module',
    ],
    // ...
],

```

### 3. 使用方法, 代码中其它地方可以这样使用

[](#3-使用方法-代码中其它地方可以这样使用)

```
$num = Yii::$app->ks->get('demo.number', 100); // 100是默认值
if ($num > 100) {
    // ...
}

```

### 4. 参考代码

[](#4-参考代码)

controller文件

```

```

[![截图](https://github.com/hbhe/yii2-settings/raw/master/screenshot.png)](https://github.com/hbhe/yii2-settings/blob/master/screenshot.png)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

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://avatars.githubusercontent.com/u/6417343?v=4)[hbhe](/maintainers/hbhe)[@hbhe](https://github.com/hbhe)

### Embed Badge

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

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

###  Alternatives

[humanmade/mu-plugins-loader

A WordPress must-use plugin autoloader for mu-plugins in directories

1122.3k](/packages/humanmade-mu-plugins-loader)[caouecs/bootstrap3

Bootstrap 3 for Laravel 4

111.9k](/packages/caouecs-bootstrap3)

PHPackages © 2026

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