yac/ajax-modal

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (dev-master) of this package.

Modal load view via ajax

Installs: 159

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2016-08-18 00:42 UTC

This package is not auto-updated.

Last update: 2018-10-25 08:14:05 UTC


README

Build Status

Requirements

  • Yii 2.0
  • PHP >= 7.0

Installation

You can use Composer to install.

  • Download composer

  • Either run

php composer.phar require yac/ajax-modal "dev-master"

or add in your composer.json

"yac/ajax-modal":"dev-master"

Basic Usage

To use yii2 Ajax Modal you must make this:

echo ajaxModal::widget([
    'button' =>[
      'text'=>'Modal Larger',
      'htmlOptions'=>['class'=>'btn btn-primary']
    ],
    'modal' => [
      'url' => Url::to(['site/contact']),
      'title' => 'My Modal',
      'button'=>[
        'save'=>Html::a('SAVE',['controller/action']),
        'cancel'=>Html::a('CANCEL',['controller/action'])
      ],

    ]
]);

Advanced Usage

echo ajaxModal::widget([
      'id'=>'myModal',
      'button'=> [
        'text'=>'Modal Larger',
        'htmlOptions'=>['class'=>'btn btn-primary']
      ],
      'modal'=>[
        'url' => Url::to(['site/contact']),
        'title' => 'Ola Mundo',
        'size' => ajaxModal::SIZE_LARGE,
        'loadSpin' => Html::img('images/loader.gif'),
        'buttons' => [
          'button1'=>Html::button('Cancel',['class'=>'btn btn-default','data-dismiss'=>'modal']),
          'button2'=>Html::submitButton('Save',['class'=>'btn btn-primary']),
        ],
        'type' =>  ajaxModal::FLAT,
        'modalOption' => []
      ]
  ])

General Options

Option Description Default Value
button The button will be display on view null
modal Modal basic implementation array

Modal Configuration

Option Description Default Value
title Title of modal empty
size Size of modal 4
loadSpin Loading animation loader.gif
buttons Buttons of modal save and cancel
type type if you need modal flat or smooth smooth
backdropColor color of backdrop black
modalOption options like keyboard array

size = EXTRA_LARGER | LARGER | MEDIUM | SMALL | EXTRA_SMALL
type = SMOOTH | FLAT

Report