PHPackages                             yljphp/validation - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. yljphp/validation

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

yljphp/validation
=================

表单验证扩展

v1.1(7y ago)015MITPHPPHP &gt;=5.4.0

Since Aug 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/yljphp/validation)[ Packagist](https://packagist.org/packages/yljphp/validation)[ RSS](/packages/yljphp-validation/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (3)Used By (0)

表单验证扩展
======

[](#表单验证扩展)

> 大部分代码基于网络，初版v1.0可能存在很多bug

### 使用方法

[](#使用方法)

1,自己定义request规则、提示信息等

```
class RequestDemo implements RequestInterface
{
    public function rules()
    {
        return [
            'username' => 'required|min:5',
            'password' => 'confirmed',
        ];
    }

    public function messages()
    {
        return [
            'required'             => ':attribute 不能为空须。',
            'min'                  => ':attribute 至少为 :min 个字符。',//或直接直接写名字最少5个字符
        ];
    }

    public function getRequestData()
    {
        return [
            'username' => 'sssss'
        ];
        //通过其他方法获取要验证的参数数组
    }

    public function attributes()
    {
        return [
            'username' => '用户名',
            'password' => '密码',
        ];
    }

}
```

2. 验证表单请求参数

```
request_validate(new RequestDemo(),$errors)
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Total

2

Last Release

2845d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/88b86734abb653d7d47d6b67eebb02cc63e8d06301d75b4beb21e0abd3c20ffe?d=identicon)[yljphp](/maintainers/yljphp)

---

Tags

requestvalidation

### Embed Badge

![Health badge](/badges/yljphp-validation/health.svg)

```
[![Health](https://phpackages.com/badges/yljphp-validation/health.svg)](https://phpackages.com/packages/yljphp-validation)
```

###  Alternatives

[composer/semver

Version comparison library that offers utilities, version constraint parsing and validation.

3.3k489.6M672](/packages/composer-semver)[giggsey/libphonenumber-for-php

A library for parsing, formatting, storing and validating international phone numbers, a PHP Port of Google's libphonenumber.

5.0k148.7M416](/packages/giggsey-libphonenumber-for-php)[respect/validation

The most awesome validation engine ever created for PHP

5.9k37.4M383](/packages/respect-validation)[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k35.7M107](/packages/propaganistas-laravel-phone)[opis/json-schema

Json Schema Validator for PHP

64236.9M186](/packages/opis-json-schema)[arondeparon/laravel-request-sanitizer

An easy to use request sanitizer that allows you to sanitize your form data before validating it.

112151.6k1](/packages/arondeparon-laravel-request-sanitizer)

PHPackages © 2026

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