icron/yii2-confirm-widget Yii2 Confirm Widget (e.g. SMS)

Build Status Code Coverage Scrutinizer Code Quality Latest Version Software License Total Downloads

yii2-confirm-widget

Yii2 Confirm Widget (e.g. SMS) Example For example,

'components' => [
        'confirm' => [
            'class' => 'icron\confirm\Confirm',
            'provider' => 'app\components\providers\ProstorSMS',
        ],
 ],
\icron\confirm\ConfirmWidget::widget([
            'model' => (new \app\models\TestModel()),
            'attribute' => 'phone',
            'clientOptions' => [
                'url' => \yii\helpers\Url::toRoute('site/confirm'),
                'btnSend' => '.btn-send',
                'btnConfirm' => '.btn-confirm',
                'inputCode' => '.input-code'
            ],
            'clientEvents' => [
                'send.ic.modal' => 'function(e){
                    console.log(e.confirmData);
                }',
                'confirm.ic.modal' => 'function(e){
                    var data = e.confirmData || {};
                    console.log(e.confirmData);
                    if (data["status"] == "success") {
                        document.location.href = "' . \yii\helpers\Url::toRoute('site/private') . '";
                    }

                }',
            ],
        ]); 
    public function actionPrivate()
    {
        /** @var Confirm $confirm */
        $confirm = Yii::$app->confirm;
        return $this->render('private', ['items' => $confirm->getConfirmedDestinations()]);
    }

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



v0.1 is the latest of one release



Unknown license
Stats
1 github stars & 0 github forks
0 downloads in the last day
0 downloads in the last 30 days
2 total downloads