2017 © Pedro Peláez
 

library yii-reklampercaptcha

Yii captcha package

image

reklamper/yii-reklampercaptcha

Yii captcha package

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

The README.md

yii-reklampercaptcha

Try out demonstration., (*1)

How install captcha widget in your project

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

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

class Comments extends CActiveRecord
{
    public $reklamperCaptcha;

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

    // other functions
}

in view file show widget:, (*4)


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

Install via composer

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

"reklamper/yii-reklampercaptcha": "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('reklamperCaptcha','vendor.reklamper.yii-reklampercaptcha.ReklamperCaptchaValidator',
    // custom error message:
    'message' => 'Validation code is incorrect',
),

in view file show widget:, (*8)

<?php 
    // summon widget
    $this->widget(
        'vendor.reklamper.yii-reklampercaptcha.ReklamperCaptcha', 
        array( 
            'model' => $model, 
            'attribute' => 'reklamperCaptcha', // its attribute name
        )
    );

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

The Versions

18/11 2014

dev-master

9999999-dev http://reklamper.com

Yii captcha package

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Kozitsin Konstantin

captcha yii