PHP code example of lfbn / json-resume-validator
1. Go to this page and download the library: Download lfbn/json-resume-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/ */
lfbn / json-resume-validator example snippets
$path = 'json_resume.json';
$validator = Lfbn\JsonResumeValidator\JsonResumeValidator::load($path);
echo 'Is valid? '.$validator->isValid();
$config = [
'mandatory_fields' => [
'basics.name',
'basics.email',
'basics.phone',
'basics.summary'
]
];
$path = 'json_resume.json';
$resume = Lfbn\JsonResumeValidator\JsonResumeValidator::load($path, $config);
// It returns true, or it throws an Exception, is it fails in any Validation.
$resume->isValid();
composer tests