PHP code example of yiier / yii2-validators

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

    

yiier / yii2-validators example snippets


public function rules()
{
    return [
        // ... 
        ['id_card', \yiier\validators\IdCardValidator::class],
        // code
    ];
}

public function rules()
{
    return [
        // ... 
        ['product_ids', \yiier\validators\ArrayValidator::class],
        // code
    ];
}

public function rules()
{
    return [
        // ... 
        ['phone', \yiier\validators\PhoneValidator::class],
        // code
    ];
}

public function rules()
{
    return [
        // ... 
        ['amount', \yiier\validators\MoneyValidator::class],
        ['amount', \yiier\validators\MoneyValidator::class, 'allowsNegative' => true],
        // code
    ];
}

php composer.phar