PHPackages                             slowlyo/owl-dict - 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. slowlyo/owl-dict

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

slowlyo/owl-dict
================

OwlAdmin 数据字典扩展

v1.3.4(4mo ago)22.8k↓33.3%45MITPHPPHP &gt;=8.0

Since Feb 10Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/Slowlyo/owl-dict)[ Packagist](https://packagist.org/packages/slowlyo/owl-dict)[ Docs](https://gitee.com/slowlyo/owl-dict)[ RSS](/packages/slowlyo-owl-dict/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (28)Used By (5)

OwlAdmin 数据字典
-------------

[](#owladmin-数据字典)

效果
--

[](#效果)

增加数据字典管理功能

安装
--

[](#安装)

#### zip 下载地址

[](#zip-下载地址)

#### composer

[](#composer)

```
composer require slowlyo/owl-dict
```

使用说明
----

[](#使用说明)

1. 安装扩展
2. 在扩展管理中启用扩展

使用方法
----

[](#使用方法)

### 配置

[](#配置)

在扩展管理中可以配置以下内容

- 屏蔽数据字典类型管理
- 屏蔽数据字典创建
- 屏蔽数据字典删除

### 调用

[](#调用)

```
// 使用助手函数
admin_dict()->getValue('user.status', '未知');
// 使用容器
app('admin.dict')->getValue('user.status', '未知');
// 使用接口获取字典选项 (该接口会返回 [['label' => xx, 'value' => xx]] 格式的数据
/admin_dict/options?path=gender
```

### 可用方法

[](#可用方法)

```
/**
 * 获取数据字典值
 * @params string $path 路径 例如: user.status
 * @params string $default 默认值
 * @params bool $needAllData 是否需要返回所有数据 (为true时返回所有数据, 包括禁用数据和软删除数据)
 * @return string 例如: 正常
 */
public function getValue($path, $default = '', $needAllData = true)

/**
 * 获取数据字典键
 * @params ...
 * @return string 例如: normal
 */
public function getKey($path, $default = '', $needAllData = true)

/**
 * 获取数据字典数据
 * @params ...
 * @return array 例如: ['key' => 'normal', 'value' => '正常']
 */
public function getAll($path, $default = [], $needAllData = true)

/**
 * 获取数据字典数据 - 选项格式
 * @params ...
 * @return array 例如: [['label' => '正常', 'value' => 'normal']]
 */
public function getOptions($path, $needAllData = true)
```

### 注意事项

[](#注意事项)

数据字典数据做了缓存, 新增或修改时会自动清理缓存
直接修改数据库数据字典表数据, 请手动清除缓存

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance74

Regular maintenance activity

Popularity24

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~141 days

Total

27

Last Release

140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/290116b53a2e657c1fe2476eeecc0890a0fcb19f11fc28756bc0bbeb1fb33e17?d=identicon)[Slowlyo](/maintainers/Slowlyo)

---

Top Contributors

[![1821725017](https://avatars.githubusercontent.com/u/70249774?v=4)](https://github.com/1821725017 "1821725017 (18 commits)")[![slowlyo](https://avatars.githubusercontent.com/u/94038215?v=4)](https://github.com/slowlyo "slowlyo (16 commits)")[![itxiao6](https://avatars.githubusercontent.com/u/20547806?v=4)](https://github.com/itxiao6 "itxiao6 (8 commits)")[![lphkxd](https://avatars.githubusercontent.com/u/16346895?v=4)](https://github.com/lphkxd "lphkxd (2 commits)")[![ilvsx](https://avatars.githubusercontent.com/u/5467343?v=4)](https://github.com/ilvsx "ilvsx (1 commits)")

---

Tags

extensionowl-adminDict

### Embed Badge

![Health badge](/badges/slowlyo-owl-dict/health.svg)

```
[![Health](https://phpackages.com/badges/slowlyo-owl-dict/health.svg)](https://phpackages.com/packages/slowlyo-owl-dict)
```

###  Alternatives

[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)
