PHP code example of satomif / extra-aura-filter-module

1. Go to this page and download the library: Download satomif/extra-aura-filter-module 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/ */

    

satomif / extra-aura-filter-module example snippets


$config = nstall(new ExtraAuraFilterModule($config));

$config = [
    'mbstrlen-max' => \Satomif\ExtraAuraFilterModule\Filter\MbStrlenMax::class
];

return $config;

use ValidationInject;

$mbString = 'こんにちは!世界2!';
$this->filter->validate('var_name')->is('mbstrlen-max', 9);
$data = ['var_name' => $mbString];
$fail = $this->filter->apply($data);
if (! $fail) {
  $msgs = (string) $this->errorString;
}