HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]
Prev Next

setModel Manual

set the look-and-feel that renders the progress bar

by by Laurent Laville
mailto:pear@laurent-laville.org
November 2003, Laurent Laville
(HTML_Progress 1.0+)

Synopsis

void setModel( $file, $type )

Attributes

Name Type
file string
type string

Description

The setModel() method is used as an easy way to customize with only one line of code and a configuration file, the look and feel of a progress bar.

Example

  1. <?php 
  2. require_once ('HTML/Progress.php');
  3.  
  4. $bar = new HTML_Progress();
  5. $bar->setAnimSpeed(50);
  6. $bar->setModel('./ancestor.ini''iniCommented');
  7. ?>
  8. <!DOCTYPE html
  9.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  10.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  11.  
  12. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  13. <head>
  14. <title>setModel example</title>
  15. <style type="text/css">
  16. <!--
  17. <?php echo $bar->getStyle()?>
  18. // -->
  19. </style>
  20. <script type="text/javascript">
  21. <!--
  22. <?php echo $bar->getScript()?>
  23. //-->
  24. </script>
  25. </head>
  26. <body>
  27.  
  28. <?php 
  29. echo $bar->toHtml()
  30.  
  31. do {
  32.     $bar->display();
  33.     if ($bar->getPercentComplete(== 1{
  34.         break;   // the progress bar has reached 100%
  35.     }
  36.     $bar->incValue();
  37. while(1);
  38. ?>
  39.  
  40. </body>
  41. </html>

See Also

setOrientation Manual, setCellAttributes Manual, setBorderAttributes Manual, setStringAttributes Manual, setProgressAttributes Manual

Prev Up Next
setBorderPainted Manual Reference Guides isIndeterminate Manual

Documentation generated on Mon, 11 Mar 2019 13:52:34 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.