GUMP Versions Save

A fast, extensible & stand-alone PHP input validation class that allows you to validate any data

v1.5.5

6 years ago

This release includes a fix for min_numeric validation rule.

v1.5.4

6 years ago

This release improves the url_exists validation rule and fixes a error messages problem.

v1.5.3

6 years ago

This release includes one new feature, two new translations, and few fixes.

  • Use another field's value as parameter for a validation rule using underscore prefix + field name as parameter. Example:
$data = [
    'min_characters' => 12,
    'characters' => 'My string'
];

$rules = [
    'min_characters' => 'required',
    'characters' => 'required|min_len,_min_characters' // equals to: min_len,12
];
  • Improved 'date' validation rule. Now you will be able to specify a custom date format. Example:
$data = [
    'date' => '01-12-2017'
];

$rules = [
    'date' => 'required|date,d-m-Y' // Spanish like format
];
  • Portuguese (#190) and Hebrew (#185) error messages translations added.
  • Consistency between custom and built-in validators improved for validate() method #188.
  • Fix for 'validate_alpha_space' validation rule #187.
  • Error messages fix when multiple GUMP instances #180.
  • Array as input values support.

v1.5.2

7 years ago

This release mainly contains the following changes:

  • validate_boolean() now can accept values like 'yes', 'no' / 'on', 'off' / '1', '0' / 'true', 'false' from input forms.
  • Russian translation for validation rules added.
  • Issue #142 solved, which will help for a better extensibility of GUMP.

v1.5.1

7 years ago

This release includes one new method involved in the multilingual support task.

The method is set_error_message():

GUMP::set_error_message('validate_required', 'The {field} field can not be empty');

You can also use set_error_messages() for multiple custom error messages:

GUMP::set_error_messages([
    'validate_required' => 'The {field} field can not be empty',
    'validate_numeric' => 'The {field} field must be a number, {param} is not a number'
]);

Four new rules: valid_array_size_greater, valid_array_size_lesser, valid_array_size_equal (see PR #175) and alpha_numeric_space (see PR #172)

1.5

7 years ago

This release includes bugfixes and also brings multilingual support to GUMP.

To use multilingual support start translating the error messages to your language inside lang folder, and then specify the language key in GUMP's constructor.

Example to switch to another language:

$lang = 'en';
$gump = new GUMP($lang);

Example of setting your custom error message on add_validator:

$message = 'The {field} must be nice';

GUMP::add_validator("is_nice", function($field, $input, $param = NULL) {
    return ($input[$field] == 'nice');
}, $message);

1.4

7 years ago

This release contains user contributed patches and documentation improvements.

1.3

8 years ago

A minor release to fix the higher priority issues that have been reported.

v1.2

8 years ago

This release contains user contributed updates and improvements. We're still working on getting the documentation cleaned up and re-written.

v1.1

9 years ago

This release mostly contains bug fixes and performance improvements on v1.0