dev-master
9999999-devModal widget for Yii2
BSD-3-Clause
The Requires
by dench
extension yii2 modal
Modal widget for Yii2
Modal widget for Yii2, (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist dench/yii2-modal "*"
or add, (*4)
"dench/yii2-modal": "*"
to the require section of your composer.json
file., (*5)
Once the extension is installed, simply use it in your code by :, (*6)
<button data-modal="/site/modal-test" data-modal-size="modal-sm">Open Modal</button> <button onclick="openModal('/site/modal-test', { size: 'modal-lg' });">Open Modal</button> <button onclick="openModal(null, { title: 'Title', body: 'Body' });">Open Modal</button> = \dench\modal\Modal::widget(); ?>
```php public function actionModalTest() { $footer = Html::button('Close', ['class' => 'btn btn-secondary', 'data-dismiss' => 'modal']);, (*7)
$model = new ModelForm(); if ($model->load(Yii::$app->request->post()) && $model->save()) { Yii::$app->session->setFlash('success', 'Success'); } else { $footer .= Html::submitButton('Ok', ['class' => 'btn btn-primary']); } $data = [ 'title' => 'Title', 'body' => $this->renderAjax('modal-test', [ 'model' => $model, ]), 'footer' => $footer, ]; return Json::encode($data);
}, (*8)
ReCaptcha ----- ```php use himiklab\yii2\recaptcha\ReCaptcha; echo ReCaptcha::widget(); $js = <<<JS if (typeof grecaptcha !== 'undefined') { recaptchaOnloadCallback(); } JS; $this->registerJs($js);
Modal widget for Yii2
BSD-3-Clause
extension yii2 modal