2017 © Pedro Peláez
 

library phalcon-validation

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

image

zvps/phalcon-validation

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

  • Wednesday, November 2, 2016
  • by Caffe1neAdd1ct
  • Repository
  • 4 Watchers
  • 2 Stars
  • 189 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Phalcon Validators

Issues with the Alpha and Numeric validators have been fixed for UTF8 support:, (*1)

https://github.com/phalcon/cphalcon/issues/11386 https://github.com/phalcon/cphalcon/issues/11374, (*2)

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

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!, (*4)

The Versions

02/11 2016

dev-master

9999999-dev

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

  Sources   Download

GPL 3.0

The Requires

  • ext-phalcon >=1.3.4
  • php >=5.3