2017 © Pedro Peláez
 

yii2-extension yii2-modal

Modal widget for Yii2

image

dench/yii2-modal

Modal widget for Yii2

  • Monday, July 9, 2018
  • by dench
  • Repository
  • 1 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 85 % Grown

The README.md

Modal widget for Yii2

Modal widget for Yii2, (*1)

Installation

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)

Usage

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);

The Versions

09/07 2018

dev-master

9999999-dev

Modal widget for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar dench

extension yii2 modal