HTML_Progress::setStringPainted
allows or not, usage of a custom progress meter string
Synopsis
require_once 'HTML/Progress.php';
void
HTML_Progress::setStringPainted(
bool
$paint)
Description
This method is used to decide whether the progress meter should paint a custom string or not.
The default value is FALSE.
By default, the progress meter displays the value returned by
HTML_Progress::getPercentComplete() method formatted as a percent such as 33%.
Parameter
- boolean
$paint
-
whether the progress meter should render a custom string
Throws
Possible PEAR_Error values
Error level |
Error code |
Error message |
Solution |
exception |
HTML_PROGRESS_ERROR_INVALID_INPUT |
invalid input, parameter #1 "$paint" was expecting "boolean" |
Fixed the cast of parameter |
Note
( HTML_Progress >= 1.0 )
| This function can not be called statically. |
See
HTML_Progress::isStringPainted,
HTML_Progress::setString
Example
Example below will produced a progress bar with a custom string.
- <?php
- require_once 'HTML/Progress.php';
-
- $bar = new HTML_Progress();
- $bar->setStringPainted(true);
- $bar->setValue(25);
-
- $ui =& $bar->getUI();
- $ui->setStringAttributes('width=350 align=left');
- ?>
- <html>
- <head>
- <title>setStringPainted example</title>
- <style type="text/css">
- <!--
- <?php echo $bar->getStyle(); ?>
- // -->
- </style>
- <script type="text/javascript">
- <!--
- <?php echo $bar->getScript(); ?>
- //-->
- </script>
- </head>
- <body>
-
- <?php
- echo $bar->toHtml();
-
- $msg = " installing package (25 %) ... : Config";
- $bar->setString($msg);
-
- $bar->display();
- ?>
-
- </body>
- </html>