2017 © Pedro Peláez
 

yii2-extension yii2-remote-modal

Yii2 Remote Modal

image

cenotia/yii2-remote-modal

Yii2 Remote Modal

  • Friday, December 8, 2017
  • by plenaerts
  • Repository
  • 2 Watchers
  • 0 Stars
  • 304 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 6 % Grown

The README.md

Yii2 Remote Modal

by cenotia, (*1)

This extension enables the use of several types of modals in a simplify way and using ajax., (*2)

In order to add it to your project you have to download the archive or use the composer tool which is the preferred way., (*3)

In your composer.json file add the following line :, (*4)

"cenotia/yii2-remote-modal":"*", (*5)

and run composer update, (*6)

In Controller

in your controller's actions (that you want to display in a modal), add the following code :, (*7)

public function actionTest() 
{
    $request = \Yii::$app->request;
    \Yii::$app->response->format = Response::FORMAT_JSON;
    return [
        'title'=> "Test Titre",
        'content'=>"Test content", // for example: $this->renderAjax('view', [
                                   //     'model' => $model,
                                   //  ]),
        'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>"modal"]).
        Html::button('Save',['class'=>'btn btn-primary','type'=>"submit"])
    ];
}

In your view

At the beginning of your file, (*8)

use cenotia\components\modal\RemoteModal;

The calling link would be, (*9)

<a href="/site/test" role="XXXXXXXXXID">Test</a>, (*10)

At the end of the view file, add this :, (*11)

<?php RemoteModal::begin([
    "id"=>"XXXXXXXXXID",
    "options"=> [ "class"=>"fade slide-right "],
    "footer"=>"", // always need it for jquery plugin
    ])?>
<?php RemoteModal::end(); ?>

The available classes in options are :, (*12)

  • slide-right
  • stick-up
  • fill-in
  • slide-up

The Versions

08/12 2017

dev-master

9999999-dev https://github.com/cenotia/yii2-remote-modal

Yii2 Remote Modal

  Sources   Download

BSD 3-Clause

yii2 bootstrap modal

09/11 2016

v1.0.3

1.0.3.0 https://github.com/cenotia/yii2-remote-modal

Yii2 Remote Modal

  Sources   Download

BSD 3-Clause

yii2 bootstrap modal

09/11 2016

v1.0.2

1.0.2.0 https://github.com/cenotia/yii2-remote-modal

Yii2 Remote Modal

  Sources   Download

BSD 3-Clause

yii2 bootstrap modal

09/11 2016

v1.0.1

1.0.1.0 https://github.com/cenotia/yii2-remote-modal

Yii2 Remote Modal

  Sources   Download

BSD 3-Clause

yii2 bootstrap modal

19/10 2016

v0.0.2

0.0.2.0 https://github.com/cenotia/yii2-remote-modal

Yii2 Remote Modal

  Sources   Download

BSD 3-Clause

yii2 bootstrap modal

19/10 2016

v0.0.1

0.0.1.0 https://github.com/cenotia/yii2-remote-modal

Yii2 Remote Modal

  Sources   Download

BSD 3-Clause

yii2 bootstrap modal

19/10 2016

v0.1

0.1.0.0 https://github.com/cenotia/yii2-remote-modal

Yii2 Remote Modal

  Sources   Download

BSD 3-Clause

yii2 bootstrap modal