Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lichunqiang/yii2-sweet-submit
sweet sumit using sweetalert
https://github.com/lichunqiang/yii2-sweet-submit
sweetalert yii2 yii2-extension yii2-sweetalert yii2-widgets
Last synced: 4 months ago
JSON representation
sweet sumit using sweetalert
- Host: GitHub
- URL: https://github.com/lichunqiang/yii2-sweet-submit
- Owner: lichunqiang
- License: mit
- Created: 2015-11-29T15:01:44.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-12T00:58:06.000Z (over 7 years ago)
- Last Synced: 2024-09-30T23:51:09.185Z (4 months ago)
- Topics: sweetalert, yii2, yii2-extension, yii2-sweetalert, yii2-widgets
- Language: PHP
- Size: 178 KB
- Stars: 27
- Watchers: 6
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-yii2 - lichunqiang/yii2-sweet-submit
README
Yii2 Sweeet Submit
[![version](https://img.shields.io/packagist/v/light/yii2-sweet-submit.svg?style=flat-square)](https://packagist.org/packages/light/yii2-sweet-submit)
[![Download](https://img.shields.io/packagist/dt/light/yii2-sweet-submit.svg?style=flat-square)](https://packagist.org/packages/light/yii2-sweet-submit)
[![Issues](https://img.shields.io/github/issues/lichunqiang/yii2-sweet-submit.svg?style=flat-square)](https://github.com/lichunqiang/yii2-sweet-submit/issues)By default `yii.js` using browser's `confirm` function to show confirm message.This library used `sweet-alert` to instead it:
![before](./media/before.gif)
![after](./media/after.gif)
## 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](http://t4t5.github.io/sweetalert/), 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](http://t4t5.github.io/sweetalert/)
## License
![MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)