定制 zvps/phalcon-validation 二次开发

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

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

zvps/phalcon-validation

最新稳定版本:2.0

Composer 安装命令:

composer require zvps/phalcon-validation

包简介

Additional form and data validators extending the inbuilt phalcon validate interface.

README 文档

README

Issues with the Alpha and Numeric validators have been fixed for UTF8 support:

phalcon/cphalcon#11386 phalcon/cphalcon#11374

However if you which to validate with whitespace or space characters then these validators may still come in handy.

Example usage

<?php

class LoginForm extends Form
{
    public function initialize($entity = null, $options = null)
    {

        $username = new Text('username', array(
            'class' => 'form-control'
        ));
        $username->setLabel('Username');
        $username->addValidators(array(
            new PresenceOf(array(
                'message' => 'Please enter your username.',
            )),
            new AlphaNumericValidator(array(
                'message' => 'Only Alpha, Numeric and Space characters please.', 
                'allowWhiteSpace' => true,
            )),
            new StringLength(array(
                'max' => 100,
                'messageMaximum' => 'Username is too long. Maximum 100 characters.',
            )),
        ));
        $this->add($username);

Pull Requests

Pull requests are more than welcome!

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-only
  • 更新时间: 2015-05-08