1. Go to this page and download the library: Download corneltek/validationkit 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/ */
corneltek / validationkit example snippets
$validtor = new PasswordValidator(array( /* options */ ), array(
'',
'max_length_error' => 'The maximum length of password is 24 charactors.'
));
namespace YourApp;
use ValidationKit\Validator;
class YourValidator extends Validator
{
public function validate($val)
{
return $this->valid();
}
}
namespace YourApp;
use ValidationKit\Validator;
class YourValidator extends Validator
{
public function getDefaultMessages()
{
return array(
'valid' => 'Its a valid value.',
'too_large' => 'Your value is too large',
'too_small' => 'Your value is too small',
);
}
public function validate($val)
{
if( $val > 30 )
return $this->invalid('too_large');
if( $val < 10 )
return $this->invalid('too_small');
return $this->valid();
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.