walkboy/yii2-ajax-progress-bar
Composer 安装命令:
composer require walkboy/yii2-ajax-progress-bar
包简介
Bootstrap progress bar widget with updating thru ajax feature for yii2
README 文档
README
Boostrap 4 progress bar widget with ability to update percent value by periodic ajax request.
Installation
composer require walkboy/yii2-ajax-progress-bar:dev-master
Usage
In your view:
<?= \walkboy\ProgressBar\ProgressBar::widget([ 'bars' => [ [ 'percent' => $model->progressPercent, // initial percent 'label' => $model->progressPercent.' %', // initial label 'options' => ['class' => 'progress-bar-primary progress-bar-animated progress-bar-striped'], ], ], 'url' => ['controller/some-progress', 'id' => $model->id], // 'period' => '10', // how often update request will be send (default 5 sec) ]) ?>
In your controller:
function actionSomeProgress($id) { $model = $this->findModel($id); return [ 'percent' => $model->progressPercent, 'label' => $model->progressPercent.' %', ]; }
统计信息
- 总下载量: 3.88k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-26