light / yii2-sweet-submit
make yii2 form submit sweet
1.0.1
2016-01-06 05:27 UTC
Requires
- yiisoft/yii2: *
Requires (Dev)
- fabpot/php-cs-fixer: ^1.11
This package is auto-updated.
Last update: 2024-10-08 19:51:43 UTC
README
Yii2 Sweeet 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
you can depends this in your assets:
class AppAsset 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