PHP code example of bitdevelopment / yii2-validators
1. Go to this page and download the library: Download bitdevelopment/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/ */
bitdevelopment / yii2-validators example snippets
use bitdevelopment\yii2validators\WordValidator;
class Post extends \yii\base\Model {
public function rules() {
return [
[['myField'],WordValidator::className(),'min'=>200,'max'=>500]
];
}
...
use bitdevelopment\yii2validators\ReCaptchaValidator;
class Post extends \yii\base\Model {
public $reCaptcha;
public function rules() {
return [
[['reCaptcha'], ReCaptchaValidator::className()],
[['reCaptcha'], '