HTML_Progress::apiVersion

HTML_Progress

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.

    <?php
    require_once 'HTML/Progress.php';

    $bar = new HTML_Progress();
    $bar->setAnimSpeed(100);
    ?>
    <head>
    <title>apiVersion 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();
    $api = $bar->apiVersion();

    if ($api < 1.2) {
        echo "API version = $api : use a basic do-while-loop";
        do {
            $bar->display();
            $bar->sleep();
            if ($bar->getPercentComplete() == 1) {
                break;
            }
            $bar->incValue();
        } while(1);
    } else {
        echo "API version = $api : use the run() method";
        $bar->run();
    }
    ?>

    </body>
    </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