2017 © Pedro PelĂĄez
 

library f3-form-validator

Form validator for FatFreeFramework based on CodeIgniter Form Validation library

image

edtsz/f3-form-validator

Form validator for FatFreeFramework based on CodeIgniter Form Validation library

  • Tuesday, June 12, 2018
  • by edtsz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 16 % Grown

The README.md

Fat-Free Framework Form Validator

This is a CodeIgniter's (GitHub) Form Validation ported to FatFreeFramework (GitHub), (*1)

Getting Start

Install

Add the following to your composer.json file:, (*2)

{
    "require": {
        "edtsz/f3-form-validator": "1.0.0"
    }
}

Then open the terminal in your project directory and run: composer install, (*3)

Running

$validator = new \Validator();
$validator->set_db( $f3->get('db.instance') ); // just if will use "is_unique"
$validator->set_rules(
    'username', 'Username',
    'required|min_length[5]|max_length[12]|is_unique[users.username]',
    array(
        'required'  => 'You have not provided %s.',
        'is_unique' => 'This %s already exists.'
    )
);
$validator->set_rules('password', 'Password',              'required');
$validator->set_rules('passconf', 'Password Confirmation', 'required|matches[password]');
$validator->set_rules('email',    'Email',                 'required|valid_email|is_unique[users.email]');

if ( $validator->run() === TRUE )
{
    // success
}
else
{
    print_r( $validator->error_array() );
}

Full information about how to use it: CI Docs, (*4)

Available Validators|Filters

CodeIgniter

  • required
  • regex_match
  • matches
  • differs
  • is_unique
  • min_length
  • max_length
  • exact_length
  • valid_url
  • valid_email
  • valid_emails
  • valid_ip
  • alpha
  • alpha_numeric
  • alpha_numeric_spaces
  • alpha_dash
  • numeric
  • integer
  • decimal
  • greater_than
  • greater_than_equal_to
  • less_than
  • less_than_equal_to
  • in_list
  • is_natural
  • is_natural_no_zero
  • valid_base64
  • prep_for_form
  • prep_url
  • strip_image_tags
  • encode_php_tags

GUMP

  • min_age
  • max_age
  • valid_name

Custom

  • is_file
  • file_min_size
  • file_max_size
  • file_types
  • valid_cpf
  • valid_date
  • valid_datetime
  • valid_time
  • convert_case
  • substr

As CI Docs says: "You can also use any native PHP functions that permit up to two parameters, where at least one is required (to pass the field data).", (*5)

Sources

TODO

  • Improve documentation
  • Examples
  • Tests

The Versions

12/06 2018

dev-master

9999999-dev https://github.com/edtsz/f3-form-validator

Form validator for FatFreeFramework based on CodeIgniter Form Validation library

  Sources   Download

GPL-3.0+

The Requires

  • php ^5.5 || ^7.0

 

form validator validation

17/02 2017

1.1.1

1.1.1.0 https://github.com/edtsz/f3-form-validator

Form validator for FatFreeFramework based on CodeIgniter Form Validation library

  Sources   Download

GPL-3.0+

The Requires

  • php ^5.5 || ^7.0

 

form validator validation

17/02 2017

1.1.0

1.1.0.0 https://github.com/edtsz/f3-form-validator

Form validator for FatFreeFramework based on CodeIgniter Form Validation library

  Sources   Download

GPL-3.0+

The Requires

  • php ^5.5 || ^7.0

 

form validator validation

16/02 2017

1.0.1

1.0.1.0 https://github.com/edtsz/f3-form-validator

Form validator for FatFreeFramework based on CodeIgniter Form Validation library

  Sources   Download

GPL-3.0+

The Requires

  • php ^5.5 || ^7.0

 

form validator validation

16/02 2017

1.0.0

1.0.0.0 https://github.com/edtsz/f3-form-validator

Form validator for FatFreeFramework based on CodeIgniter Form Validation library

  Sources   Download

MIT

The Requires

  • php ^5.5 || ^7.0

 

form validator validation