定制 beingnikhilesh/validation 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

beingnikhilesh/validation

最新稳定版本:v0.0.4

Composer 安装命令:

composer require beingnikhilesh/validation

包简介

An Awesome Validation Engine for PHP

README 文档

README

An Awesome Validation Engine for PHP

License: MIT

Description

This package provides a powerful and flexible validation engine for PHP applications. It's designed to work seamlessly with PHP 7.0+ and integrates well with CodeIgniter projects. The library offers a clean, fluent syntax for validating various types of data.

Installation

You can install the package via composer:

composer require beingnikhilesh/validation

Requirements

  • PHP 7.0+
  • Respect/Validation library

Usage

# Usage Outline
Validation::Category()->function('value', 'name to display', [Validator Enums], [Additional Parameters])

# Validate a simple string
Validation::String()->validateString('Dan Swarovski', 'First Name');
# Validate with Muted Errors
Validation::String(Validator::muteErrors)->validateReferenceNo('xyz-1234-@', 'Reference No', Validator::AllowNull);
# Validate reference numbers
Validation::String()->validateReferenceNo('xyz-1234-@', 'Reference No', Validator::AllowNull);
# Validate query strings
Validation::String()->isQueryString('x=1&xyz=12&yuo=me&me=you&rs=&XY=', 'Query String', [Validator::AllowNull]);
# Validate addresses (with UTF16 support)
Validation::String()->validateAddress('Sr. No. 90, AXGPM875465465*&^% Facebook Addressॐ', 'Addresses', Validator::UTF16);

Features

  • Fluent, chainable API for clean code
  • Comprehensive validation rules
  • UTF-16 support for international character sets
  • Customizable error messages
  • Mutable error handling
  • Support for null values with the AllowNull flag
  • Query string validation
  • Address validation with multi-line support

Integration with Respect/Validation

This package uses the Respect/Validation library for additional validation rules and flexibility.

License

The MIT License (MIT). Please see License File for more information.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-27