1. Go to this page and download the library: Download forestry/form-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/ */
forestry / form-validator example snippets
$validator = new Forestry\FormValidator\Validator();
$rules = [
'name' => 'alpha|
$validator->validate($_POST, $rules);
if ($validator->hasErrors()) {
$errors = $validator->getErrors();
}
use Forestry\FormValidator\SimpleRuleInterface;
MyRule implements SimpleRuleInterface
{
public function validate($value)
{
// Your code.
}
public function getMessage($value)
{
// Your code.
}
}
$validator->registerRule('myrule', '\MyRule');
$validator->updateRule('url', '\MyRule');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.