yii2-sweet-submit [ 2.0 版本 ]
yii2-sweet-submit
By default yii.js
using browser's confirm
function to show confirm message.This library used sweet-alert
to instead it:
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
__FresHmaN
注册时间:2015-05-05
最后登录:2016-02-15
在线时长:0小时54分
最后登录:2016-02-15
在线时长:0小时54分
- 粉丝2
- 金钱35
- 威望20
- 积分235
共 0 条评论