yac / ajax-modal
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
Requires
- php: >=5.6
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2018-10-25 08:14:05 UTC
README
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
size = EXTRA_LARGER | LARGER | MEDIUM | SMALL | EXTRA_SMALL
type = SMOOTH | FLAT
Report
- Report any issue On the Github