A fast, extensible & stand-alone PHP input validation class that allows you to validate any data
This release includes a fix for min_numeric validation rule.
This release improves the url_exists validation rule and fixes a error messages problem.
This release includes one new feature, two new translations, and few fixes.
$data = [
'min_characters' => 12,
'characters' => 'My string'
];
$rules = [
'min_characters' => 'required',
'characters' => 'required|min_len,_min_characters' // equals to: min_len,12
];
$data = [
'date' => '01-12-2017'
];
$rules = [
'date' => 'required|date,d-m-Y' // Spanish like format
];
This release mainly contains the following changes:
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)
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);
This release contains user contributed patches and documentation improvements.
A minor release to fix the higher priority issues that have been reported.
This release contains user contributed updates and improvements. We're still working on getting the documentation cleaned up and re-written.
This release mostly contains bug fixes and performance improvements on v1.0