PHPackages                             lunacy/yii2-helpers - 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. lunacy/yii2-helpers

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

lunacy/yii2-helpers
===================

扩展了yii2框架本身的一些helper，以及自己添加的一些helpers

v1.1.0(7y ago)09BSD-3-ClausePHP

Since May 10Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Luna-CY/yii2-helpers)[ Packagist](https://packagist.org/packages/lunacy/yii2-helpers)[ Docs](https://github.com/Luna-CY/Yii2-helpers)[ RSS](/packages/lunacy-yii2-helpers/feed)WikiDiscussions master Synced yesterday

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

Yii2-helper
===========

[](#yii2-helper)

对yii2框架基础的helpers进行了一些扩展

ArrayHelper
-----------

[](#arrayhelper)

- decode: 提供了对数组的解析、过滤操作
- extract: 支持对数组提取指定的列，可支持多维数组结构
- except: 支持移除数组中的指定的列，可支持多维数组结构
- trim: 对数组元素进行过滤操作，支持自定义函数

StringHelper
------------

[](#stringhelper)

- getPassword: 返回密码的32位md5格式
- xssClean: 过滤xss攻击代码
- generateRandomString: 生成一个随机字符串，支持前缀、定长、设置随机因子
- generateSimpleRandomString: 生成一个简单的随机字符串，随机长度不能超过62位，支持前缀
- generateUniqueId: 生成一个唯一ID，固定32位长度
- hideIdentity: 对手机号码和邮箱进行加密操作

QueryHelper
-----------

[](#queryhelper)

- parseCondition: 根据请求字符串的内容解析出来AR的where条件
- parseOrder: 根据请求字符串的内容解析出来AR的order条件
- parseQueryPage: 获取当前请求的页数
- parseQuerySize: 获取当前请求的数据列表长度
- parseOffset: 获取当前查询的偏移量
- getTotalPages: 计算总页数
- getInformation: 拼装请求的信息数组

FileHelper
----------

[](#filehelper)

- getFileTimes: 获取文件的三种时间
- getExtensionByMimeType: 通过文件的mimeType获取文件的后缀名
- saveUploadFileByName: 通过上传的文件名称保存文件
- saveUploadFilesByName: 通过上传的文件名称保存所有文件
- remove: 移除文件或文件夹
- getRootPath: 获取web根目录
- getImageUrl: 转换图片的路径地址
- getUploadFileRootPath: 获取配置的上传文件的根目录

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

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

Total

2

Last Release

2906d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c99dac3c31003f0923d50c3ec821a2603587fea3cc1a75a3fbd5e0d01b8b954d?d=identicon)[Luna-CY](/maintainers/Luna-CY)

---

Top Contributors

[![Luna-CY](https://avatars.githubusercontent.com/u/7150299?v=4)](https://github.com/Luna-CY "Luna-CY (13 commits)")

---

Tags

helperyii2extension

### Embed Badge

![Health badge](/badges/lunacy-yii2-helpers/health.svg)

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

PHPackages © 2026

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