__FresHmaN 2015-12-07 22:53:31 5772次浏览 0条评论 3 0 1

yii2-sweet-submit

version
Download
Issues

By default yii.js using browser's confirm function to show confirm message.This library used sweet-alert to instead it:

before

after

Install

$ composer require light\yii2-sweet-submit=*

Usage

Can can depends this in your assets:

class YourAsset extends AssetBundle
{
    //..

    public $depends = [
        //your other depends
        'light\widgets\SweetSubmitAsset'
    ];
}

Or directly inject in the view:

use light\widgets\SweetSubmitAsset;

SweetSubmitAsset::register($this);

Once you had depends it in your project, yii.swal is available. What's this? It's just the sweet-alert, now you can use it:

//your some.js
yii.swal('Opps. this is shown by sweet-alert');

There is more usage you can find from document

License

MIT

    没有找到数据。
您需要登录后才可以评论。登录 | 立即注册