1. Go to this page and download the library: Download bitapps/wp-validator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bitapps / wp-validator example snippets
use BitApps\WPValidator\Validator;
$validator = new Validator;
use BitApps\WPValidator\Rule;
class BooleanRule extends Rule
{
// error message if fails...
private $message = "The :attribute must be a boolean";
public function validate($value)
{
// validation code here...
return is_bool($value);
}
public function message()
{
return $this->message;
}
}
$rules = [
'agreed' => ['
$customMessages = [
'ute cannot contain any numerics',
'between' => 'The :attribute must be given between :min & :max',
'size' => 'The account number must consist of :size characters',
];
$customMessages = [
'first_name' => [
'xcept letters in the first name',
],
'email' => [
'email' => 'The provided email is not valid',
],
];
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.