jcabanillas/yii2-simple-loading
Composer 安装命令:
composer require jcabanillas/yii2-simple-loading
包简介
Simple Loading
关键字:
README 文档
README
Simple Loading widget for Yii framework 2.0 or later
Description
jcabanillas\simpleloading\SimpleLoading widget is a simple way to show a loading screen in your views.
Requirements
- Yii Version 2.0.0 or later
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist jcabanillas/yii2-simple-loading "*"
or add
"jcabanillas/yii2-simple-loading": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your PHP code:
// ... use jcabanillas\simpleloading\SimpleLoading; // ... SimpleLoading::widget(); // ...
In javascript call start and stop to control the loading widget
/* * start(image type) * Allows to start the loading image and select the image to show * options: [box, clock, default, gears, hourglass, magnify, reload, ring-alt, ring, ripple, rolling] */ SimpleLoading.start('gears'); // Load gears.gif SimpleLoading.start('default'); // Load default.gif SimpleLoading.start(); // Load default.gif /* * * Allows to stop the loading image */ SimpleLoading.stop(); // Example: $.ajax( { 'type':'POST', 'dataType':'json', 'url':'index.php?r=controller/action', 'beforeSend':function(json) { SimpleLoading.start('gears'); }, 'success':function(json){/* ... */}, 'error':function(json,status,errorThrown ){/* ... */}, 'complete':function(json) { SimpleLoading.stop(); }, 'cache':false, 'data':jQuery(this).parents("form").serialize() } );
History
- Version 1.0.0 (2017-05-30)
- Tested on Yii 2.0.6
- Version 1.0.1 (2017-10-30)
- Tested on Yii 2.0.12
统计信息
- 总下载量: 174
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-08-20