1. Go to this page and download the library: Download imarc/checkpoint library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
imarc / checkpoint example snippets
classCustomInspectorextendsCheckpoint\Inspector{
protectedfunctionvalidate($data){
//// Your validation logic here//
}
}
$custom_inspector = new CustomInspector();
$custom_inspector->setValidator(new Respect\Validation\Validator());
publicfunctionvalidate($data){
if ($this->people->findOneByEmail($data['email'])) {
$this->log('email', 'The e-mail address must be unique in our system.');
}
}
publicfunctionvalidate($data){
$this->define('descLength', 'Please enter a description of at least 100 characters.')
-> length(100);
$this->check('description', $data['description'], ['descLength']);
}
$person = new Person();
$person->setFirstName('Matthew');
$person->setLastName('Sahagian');
...
$person_inspector->run($person)