jfernando/php-validate 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jfernando/php-validate

最新稳定版本:1

Composer 安装命令:

composer require jfernando/php-validate

包简介

A Java Bean Validation based for PHP

README 文档

README

A set of tools for validations with PHP.

Introduction

This library offers tools for validations of many kinds of problem:

  • ValidatorVerifier A set of tools for object validations based in annotations, having inspiration in Java Beans Validations
  • Transformation A object transformation based in annotations
  • MapValidate A simple set of tools for validate associative array
  • Schema A set of tools for validate associative array, schema based, inspirated in hapijs/joi

ValidatorVerifier

    

Transformation

    

MapValidate

    

Schema

    $schema = Schema::schema([
        'name'    => Schema::string()->min(3)->max(80),
        'address' => Schema::schema([
            'street' => Schema::string()->min(3)->max(50)
            'number' => Schema::numeric(['code' => 'invalid_number', 'message' => 'Invalid number']),
            'other' => Schema::string()->required(false) // Optional field
        ]),
        'projects'  => Schema::array()->schema([
            'name' => Schema::string()
        ])
    ]);
    
    $errors = $schema->getErrors($data);
    $errors->isValid(); // true | false
    $errors->getErrors(); //

This library is expansive for use custom validations

统计信息

  • 总下载量: 721
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-10-26