承接 mohammedalkutrani/validator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

mohammedalkutrani/validator

Composer 安装命令:

composer require mohammedalkutrani/validator

包简介

validate form-data

README 文档

README

Latest Version on Packagist

It's a simple packge for validation the data before touch your database.

Core Features

  • PSR-4 for autoloading.
  • PSR-2 for coding style.
  • Strategy Pattern for changing the rules in the runtime.
  • Facade Pattern for make it esey to use.
  • Implements your own rule.
  • Test 100%.

Installation

composer require mohammedalkutrani/validator

Simple Usage

    use Validator\Facade\Validation;
    use Validator\Rules;

    $v = Validation::make(
        [
            // the given data.
            'name' => 'mohammedalkutrani@gmail.com',
            'age' => 25
        ], [
            // the rules for the data.
            'name' => [Rules::NUMBER, Rules::MIN.'|4'],
            'age' => [Rules::EMAIL]
        ]
    );

    // check if it passed
    if(!$v->isPassed()) // it will return boolean
    { 
        print_r($v->getMessages()); // getting the messages.
    }
    

The result

    Array
    (
        [name] => Array
            (
                [0] => the name should be a number
                [1] => the name should shorter then 4
            )

        [age] => Array
            (
                [0] => the age should be an email
            )

    )

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-01-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固