PHP code example of modus / forms

1. Go to this page and download the library: Download modus/forms 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/ */

    

modus / forms example snippets


$fields = [
  'username',
  'password',
  'password_verify',
];

protected function configureValidations()
{
  $filter = $this->filter;
  $filter->addSoftRule('username', $filter::IS, 'alnum');
  $filter->addSoftRule('username', $filter::IS_NOT, 'blank');
  $filter->addSoftRule('password', $filter::IS_NOT, 'blank');
  $filter->addSoftRule('password_verify', $filter::IS, 'equalToField', 'password');
}