GithubHelp home page GithubHelp logo

lichunqiang / yii2-sweet-submit Goto Github PK

View Code? Open in Web Editor NEW
27.0 6.0 8.0 182 KB

sweet sumit using sweetalert

License: MIT License

PHP 71.33% JavaScript 28.67%
yii2 yii2-extension yii2-widgets sweetalert yii2-sweetalert

yii2-sweet-submit's Introduction

Yii2 Sweeet 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

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

License

MIT

yii2-sweet-submit's People

Contributors

lichunqiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

yii2-sweet-submit's Issues

无法安装

执行这个:composer require light\yii2-sweet-submit=*

Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package lightyii2-sweet-submit could not be found in any ver
sion, there may be a typo in the package name.

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further commo
n problems.

Installation failed, reverting ./composer.json to its original content.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.