HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]
Prev Next
HTML_Progress::apiVersion
returns the current API version

Synopsis

require_once 'HTML/Progress.php';

float HTML_Progress::apiVersion()

Description

This method is used to retrieve the current API version.

Note

( HTML_Progress >= 0.1 )

This function can be called statically.

Example

In example below we check the API version, because run() method is only available since 1.2.0RC3.

  1. <?php
  2. require_once 'HTML/Progress.php';
  3.  
  4. $bar = new HTML_Progress();
  5. $bar->setAnimSpeed(100);
  6. ?>
  7. <head>
  8. <title>apiVersion example</title>
  9. <style type="text/css">
  10. <!--
  11. <?php echo $bar->getStyle(); ?>
  12. // -->
  13. </style>
  14. <script type="text/javascript">
  15. <!--
  16. <?php echo $bar->getScript(); ?>
  17. //-->
  18. </script>
  19. </head>
  20. <body>
  21.  
  22. <?php
  23. echo $bar->toHtml();
  24. $api = $bar->apiVersion();
  25.  
  26. if ($api < 1.2) {
  27. echo "API version = $api : use a basic do-while-loop";
  28. do {
  29. $bar->display();
  30. $bar->sleep();
  31. if ($bar->getPercentComplete() == 1) {
  32. break;
  33. }
  34. $bar->incValue();
  35. } while(1);
  36. } else {
  37. echo "API version = $api : use the run() method";
  38. $bar->run();
  39. }
  40. ?>
  41.  
  42. </body>
  43. </html>

Prev Up Next
Reference Guide Reference Guide HTML_Progress::display

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