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

setStringPainted Manual

allow or not, usage of a custom progress string

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

Synopsis

void setStringPainted( $paint )

Attributes

Name Type
paint boolean

Description

The setStringPainted() method is used to decide whether the progress bar should paint a custom string or not. The default value is FALSE.

By default, the progress bar displays the value returned by HTML_Progress::getPercentComplete() method formatted as a percent such as 33%.

Example

Example below will produced a progress bar with a custom string.

  1. <?php 
  2. require_once ('HTML/Progress.php');
  3.  
  4. $bar = new HTML_Progress();
  5. $bar->setStringPainted(true);
  6. $bar->setValue(25);
  7.  
  8. $ui =$bar->getUI();
  9. $ui->setStringAttributes('width=350 align=left');
  10. ?>
  11. <!DOCTYPE html
  12.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  13.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  14.  
  15. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  16. <head>
  17. <title>setStringPainted example</title>
  18. <style type="text/css">
  19. <!--
  20. <?php echo $bar->getStyle()?>
  21. // -->
  22. </style>
  23. <script type="text/javascript">
  24. <!--
  25. <?php echo $bar->getScript()?>
  26. //-->
  27. </script>
  28. </head>
  29. <body>
  30.  
  31. <?php 
  32. echo $bar->toHtml()
  33.  
  34. $msg "&nbsp; installing package (25 %) ... : Config";
  35. $bar->setString($msg);
  36.  
  37. $bar->display();
  38. ?>
  39.  
  40. </body>
  41. </html>

See Also

isStringPainted Manual, setString Manual

Prev Up Next
isStringPainted Manual Reference Guides isBorderPainted Manual

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