HTML_Progress::setModel
sets the look-and-feel that renders the progress meter
Synopsisrequire_once 'HTML/Progress.php';
void HTML_Progress::setModel(
string $file
string $type)
DescriptionThis 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 meter.
Parameter- string
$file
-
file name of the configuration file that include model properties.
- string
$type
-
type of external ressource (phpArray, iniFile, XML ...).
ThrowsPossible PEAR_Error values Error level |
Error code |
Error message |
Solution |
error |
HTML_PROGRESS_ERROR_INVALID_INPUT |
invalid input, parameter #1 "$file" was expecting "file exists" |
Fixed filename and path if misspell |
error |
HTML_PROGRESS_ERROR_INVALID_INPUT |
invalid input, parameter #1 "$ui" was expecting "(a valid Config Container)" |
Read the manual of PEAR::Config package |
Note( HTML_Progress >= 1.0, Config >= 0.9 )
| This function can not be called statically. |
| You can use the same PHP code with different configuration files to present as much skins
as you want. |
SeeHTML_Progress::setAnimSpeed,
HTML_Progress::setIndeterminate,
HTML_Progress::setIncrement,
HTML_Progress_UI::setScript,
HTML_Progress_UI::setOrientation,
HTML_Progress_UI::setFillWay,
HTML_Progress_UI::setCellCount,
HTML_Progress_UI::setCellAttributes,
HTML_Progress::setBorderPainted,
HTML_Progress_UI::setBorderAttributes,
HTML_Progress::setStringPainted,
HTML_Progress_UI::setStringAttributes,
HTML_Progress_UI::setProgressAttributes
ExampleExample below (that requires HTML_Progress >= 1.2.0RC3) will produced the most older
progress bar style.
- <?php
- require_once 'HTML/Progress.php';
-
- $bar = new HTML_Progress();
- $bar->setModel('./ancestor.ini', 'iniCommented');
- $bar->setAnimSpeed(50); // override the delay execution model
- ?>
- <html>
- <head>
- <title>setModel 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>
Prev |
Up |
Next |
HTML_Progress::setUI |
Reference Guide |
HTML_Progress::isIndeterminate |
|
|