2017 © Pedro Peláez
 

library yii-parrotifycaptcha

Yii captcha package

image

parrotify/yii-parrotifycaptcha

Yii captcha package

  • Tuesday, November 18, 2014
  • by betadog
  • Repository
  • 1 Watchers
  • 2 Stars
  • 27 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

yii-parrotifycaptcha

Try out demonstration., (*1)

How install captcha widget in your project

Extract files from archive to folder: ext.parrotifyCaptcha, (*2)

In model declare attribute and add validation rules:, (*3)

class Comments extends CActiveRecord
{
    public $parrotifyCaptcha;

    public function rules()
    {
        return array_merge( parent::rules(), array(
            array('parrotifyCaptcha','required',),
            array('parrotifyCaptcha','ext.parrotifyCaptcha.ParrotifyCaptchaValidator',
                // custom error message:
                'message' => 'Validation code is incorrect',
            ),
        ));
    }

    // other functions
}

in view file show widget:, (*4)


widget( 'ext.parrotifyCaptcha.ParrotifyCaptcha', array( 'model' => $model, 'attribute' => 'parrotifyCaptcha', // its attribute name ) ); //and error message echo CHtml::error($model,'parrotifyCaptcha'); ?>

Install via composer

Add package to composer.json:, (*5)

"parrotify/yii-parrotifycaptcha": "dev-master"

Add vendor alias into /index.php:, (*6)

...
$vendorPath = ABSOLUTE_PATH_TO_COMPOSER.'/vendor');
Yii::setPathOfAlias('vendor', $vendorPath);
...

In model declare attribute and add validation rules:, (*7)

array('parrotifyCaptcha','vendor.parrotify.yii-parrotifycaptcha.ParrotifyCaptchaValidator',
    // custom error message:
    'message' => 'Validation code is incorrect',
),

in view file show widget:, (*8)

<?php 
    // summon widget
    $this->widget(
        'vendor.parrotify.yii-parrotifycaptcha.ParrotifyCaptcha', 
        array( 
            'model' => $model, 
            'attribute' => 'parrotifyCaptcha', // its attribute name
        )
    );

    //and error message
    echo CHtml::error($model,'parrotifyCaptcha');
?>

The Versions

18/11 2014

dev-master

9999999-dev http://parrotify.com

Yii captcha package

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Kozitsin Konstantin

captcha yii