2017 © Pedro Peláez
 

library html

html

image

zodream/html

html

  • Thursday, July 26, 2018
  • by zx648383079
  • Repository
  • 1 Watchers
  • 0 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 19 % Grown

The README.md

html

html模块组, (*1)

Progress 使用指南

注意:此方法不适用于并发高场景,目前不支持嵌套

实例, (*2)


class Progress extends Zodream\Html\Progress { public function init() { $this->data = [$this->options['a'], 2]; $this->setStart(0); } public function play($item) { // $item = 1 // $item = 2 } } $progress = new Progess([ 'a' => 1 ]) $progress();

具体和web 协作显示进度, (*3)


function getProgress() { if (isset($_POST['key'])) { return cache($_POST['key']); } return new Progess([ 'a' => 1 ]); } $progress = getProgress(); json_encode($progress());

js 部分, (*4)

loopStep = function (data) {
    if (data.key) {
        postJson('/async', data, loopStep);
        return;
    }
    // 完成
}
postJson('/async', {}, loopStep);

返回值说明, (*5)

'key' => '缓存key, 有时表示执行未完成,需要传此key继续',
'current' => '当前执行的最后一个',
'next' => '下一个',
'count' => '总个数',
'time' => '本次执行时间',
'spent' => '总执行时间'

完成返回, (*6)

'count' => '总个数',
'spent' => '总执行时间'

The Versions

26/07 2018

dev-master

9999999-dev https://github.com/zodream/html

html

  Sources   Download

MIT Apache Licence 2.0

The Requires

 

html zodream

30/06 2018
24/01 2018
10/12 2017

v1.0

1.0.0.0 https://github.com/zodream/html

html

  Sources   Download

Apache Licence 2.0

The Requires

 

html zodream