Examples TOCexamples TOC

HTML_Page Basic Monitor

$Date: 2004/04/18 13:25:43 $

 Table of contents

Introduction

This example will run a basic ProgressBar Monitor, and used a HTML_Page QuickForm renderer without any form template customizations. No user callback was defined.

[Top]

 PHP script

Build the progress bar


<?php 

$bar =& $monitor->getProgressElement();
$bar->setAnimSpeed(50);

?>

[Top]

 Render options

None used. Only default values.

[Top]

 Output

Screenshot

[Top]

 Play full example

Run the script below :


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

$p = new HTML_Page(array(
        'charset'  => 'utf-8',
        'lineend'  => OS_WINDOWS ? 'win' : 'unix',
        'doctype'  => "XHTML 1.0 Strict",
        'language' => 'en',
        'cache'    => 'false'
     ));        

$p->setTitle("PEAR::HTML_Progress - Simple Monitor demo");
$p->setMetaData("author", "Laurent Laville");

$progressMonitor = new HTML_Progress_Monitor();

$bar =& $progressMonitor->getProgressElement();
$bar->setAnimSpeed(50);

$p->addStyleDeclaration(
    $progressMonitor->getStyle()
    );
$p->addScriptDeclaration(
    $progressMonitor->getScript()
    );
$p->addBodyContent(
    '<h1>PEAR::HTML_Page renderer without user-callback</h1>'
    );
$p->addBodyContent(
    $progressMonitor->toHtml()
    );
$p->display();

$progressMonitor->run();
?>

href:  ./monitor_htmlpage.php

[Top]