HTML_Progress_UI::setCellCount
sets the new number of cell in a progress bar
Synopsis
require_once 'HTML/Progress/UI.php';
void
HTML_Progress_UI::setCellCount(
int
$cells)
Description
This method is used to set the new number of cell in the progress bar.
Parameter
- integer
$cells
-
the new count of cell in the progress bar.
Throws
Possible PEAR_Error values
Error level |
Error code |
Error message |
Solution |
exception |
HTML_PROGRESS_ERROR_INVALID_INPUT |
invalid input, parameter #1 "$cells" was expecting "integer" |
Fixed the cast of parameter |
error |
HTML_PROGRESS_ERROR_INVALID_INPUT |
invalid input, parameter #1 "$cells" was expecting "greater or equal 1" |
Give an integer greater than one |
Note
( HTML_Progress >= 1.0 )
| This function can not be called statically. |
See
HTML_Progress_UI::getCellCount
Example
Example below (that requires HTML_Progress >= 1.2.0RC3) will produced a progress bar
with less than ten default cells (see line 11).
It's a dynamic example, the progress bar will run.
| |
- <?php
- require_once 'HTML/Progress.php';
-
- $bar = new HTML_Progress();
- $bar->setAnimSpeed(100);
- $bar->setIncrement(10);
- $bar->setBorderPainted(true);
-
- $ui =& $bar->getUI();
- $ui->setFillWay('reverse');
- $ui->setCellCount(5);
- $ui->setCellAttributes('active-color=#970038 inactive-color=#FFDDAA width=20');
- $ui->setBorderAttributes('width=1 color=#000000');
- $ui->setStringAttributes('font-size=14 color=#FF0000 align=left valign=bottom');
- ?>
- <!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
- <head>
- <title>setCellCount 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();
- $bar->run();
- ?>
-
- </body>
- </html>