* @package HTML_Progress */ require_once ('HTML/Progress.php'); class TimerProgress extends HTML_Progress_DM { function TimerProgress() { $this->HTML_Progress_DM(0,60,5); } } $timer = new TimerProgress(); $bar = new HTML_Progress($timer); $bar->setStringPainted(true); // get space for the string $bar->setString(''); // but don't paint it $ui =& $bar->getUI(); $ui->setStringAttributes('width=170 height=20 valign=bottom align=center'); ?> ProgressBar model example

toHtml(); do { $bar->display(); if ($bar->getPercentComplete() == 1) { $bar->setString('All done!'); $bar->display(); break; // the progress bar has reached 100% } if ($bar->getPercentComplete() == 0.25) { $bar->setString('Fourth part way done!'); } if ($bar->getPercentComplete() == 0.5) { $bar->setString('Half way done!'); } if ($bar->getPercentComplete() == 0.75) { $bar->setString('Three quarters way done!'); } $bar->incValue(); } while(1); ?>

<< Back examples TOC

print_r

toArray()); 
?>