PHPackages                             syan/validator - 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. syan/validator

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

syan/validator
==============

Validator

v3.0.3(4y ago)0112↓100%Apache-2.0PHPPHP &gt;=7.0.0

Since Dec 27Pushed 10mo agoCompare

[ Source](https://github.com/SyanH/validator)[ Packagist](https://packagist.org/packages/syan/validator)[ Docs](https://openmix.org/mix-php)[ RSS](/packages/syan-validator/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (22)Used By (0)

> OpenMix 出品：[https://openmix.org](https://openmix.org/mix-php)

Mix Validator
=============

[](#mix-validator)

Validator based on PSR-7 standard

基于 PSR-7 标准的验证器

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

[](#installation)

```
composer require mix/validator

```

创建表单
----

[](#创建表单)

继承 `Mix\Validator\Validator` 并定义：

- `public $name` 字段名
- `rules()` 验证规则
- `scenarios()` 验证场景
- `messages()` 错误消息

```
