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

getString Manual

returns the current value of the progress string

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

Synopsis

string getString()

Description

The getString() method is used to print a custom string. 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->setValue(25);
  6. $bar->setStringPainted(true);
  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>getString 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. $val $bar->getValue();
  35. $msg = "&nbsp; installing package ($val %) ... : Config";
  36. $bar->setString($msg);
  37.  
  38. $bar->display();
  39.  
  40. print($bar->getString());
  41. ?>
  42.  
  43. </body>
  44. </html>

See Also

setString Manual, isStringPainted Manual, setStringPainted Manual

Prev Up Next
setIdent Manual Reference Guides setString Manual

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