PHP code example of zodream / html

1. Go to this page and download the library: Download zodream/html library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zodream / html example snippets



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();



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

$progress = getProgress();
json_encode($progress());


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

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