icron / yii2-confirm-widget
Yii2 Confirm Widget (e.g. SMS)
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/jquery.cookie: 1.4.1
- yiisoft/yii2: 2.0.5
- yiisoft/yii2-bootstrap: ~2.0.0
Requires (Dev)
- phpunit/phpunit: 4.*
This package is auto-updated.
Last update: 2024-12-23 02:42:17 UTC
README
yii2-confirm-widget
Yii2 Confirm Widget (e.g. SMS) 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()]); }