HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]
Prev Next
HTML_Progress::setModel
sets the look-and-feel that renders the progress meter

Synopsis

require_once 'HTML/Progress.php';

void HTML_Progress::setModel( string $file string $type)

Description

This 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 ...).

Throws

Possible 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.

See

HTML_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

Example

Example below (that requires HTML_Progress >= 1.2.0RC3) will produced the most older progress bar style.

  1. <?php
  2. require_once 'HTML/Progress.php';
  3.  
  4. $bar = new HTML_Progress();
  5. $bar->setModel('./ancestor.ini', 'iniCommented');
  6. $bar->setAnimSpeed(50); // override the delay execution model
  7. ?>
  8. <html>
  9. <head>
  10. <title>setModel example</title>
  11. <style type="text/css">
  12. <!--
  13. <?php echo $bar->getStyle(); ?>
  14. // -->
  15. </style>
  16. <script type="text/javascript">
  17. <!--
  18. <?php echo $bar->getScript(); ?>
  19. //-->
  20. </script>
  21. </head>
  22. <body>
  23.  
  24. <?php
  25. echo $bar->toHtml();
  26. $bar->run();
  27. ?>
  28.  
  29. </body>
  30. </html>

Prev Up Next
HTML_Progress::setUI Reference Guide HTML_Progress::isIndeterminate

Documentation generated on Sun, 12 Sep 2004 20:23:11 +0200 by phpDocumentor 1.3.0RC3