, (*1)
Yii2 Sweeet Submit
, (*2)
By default yii.js
using browser's confirm
function to show confirm message.This library used sweet-alert
to instead it:, (*3)
, (*4)
, (*5)
Install
$ composer require light\yii2-sweet-submit=*
Usage
you can depends this in your assets:, (*6)
class AppAsset extends AssetBundle
{
//..
public $depends = [
//your other depends
'light\widgets\SweetSubmitAsset'
];
}
Or directly inject in the view:, (*7)
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:, (*8)
//your some.js
yii.swal('Opps. this is shown by sweet-alert');
There is more usage you can find from document, (*9)
License
, (*10)