本文整理汇总了PHP中HTML_Progress::setValue方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Progress::setValue方法的具体用法?PHP HTML_Progress::setValue怎么用?PHP HTML_Progress::setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_Progress
的用法示例。
在下文中一共展示了HTML_Progress::setValue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
require_once 'HTML/Progress.php';
$bar = new HTML_Progress();
$bar->setValue(50);
$bar->setBorderPainted(true);
$ui =& $bar->getUI();
$ui->setFillWay('reverse');
$ui->setCellCount(5);
$ui->setCellAttributes('active-color=#970038 inactive-color=#FFDDAA width=20');
$ui->setBorderAttributes('width=1 color=#000000');
$ui->setStringAttributes('font-size=14 color=#FF0000 align=left valign=bottom');
?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>setStringAttributes example</title>
<style type="text/css">
<!--
<?php
echo $bar->getStyle();
?>
// -->
</style>
<script type="text/javascript">
<!--
<?php
echo $ui->getScript();
示例2:
<?php
require_once 'HTML/Progress.php';
$bar = new HTML_Progress();
$bar->setValue(45);
printf('direct way: value = %d <br/>', $bar->getValue());
$dm =& $bar->getDM();
$dm->setValue(45);
printf('another way: value = %d <br/>', $dm->getValue());
示例3:
<?php
require_once 'HTML/Progress.php';
$bar = new HTML_Progress();
$bar->setStringPainted(true);
$bar->setValue(25);
$ui =& $bar->getUI();
$ui->setStringAttributes('width=350 align=left');
?>
<html>
<head>
<title>setStringPainted 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();
示例4: while
<?php
echo $bar1->toHTML();
?>
</td>
<td width="25%" align="center">
<?php
echo $bar2->toHTML();
?>
</td>
</tr>
</table>
<?php
do {
$bar1->display();
$bar1->process();
// warning: don't forget it (even for a demo)
if ($bar1->getPercentComplete() == 1) {
$bar1->setValue(0);
// the 1st progress bar has reached 100%, do a new loop
} else {
$bar1->incValue();
// updates 1st progress bar
}
} while ($bar2->getPercentComplete() < 1);
?>
<p><< <a href="../index.html">Back examples TOC</a></p>
</body>
</html>
示例5:
//-->
</script>
</head>
<body>
<?php
echo $bar->toHtml();
$loop = 0;
do {
$bar->display();
$bar->sleep();
// for purpose of demo only
if ($bar->getPercentComplete() == 1) {
$loop++;
if ($bar->isIndeterminate()) {
$bar->setValue(0);
} else {
break;
// progress bar reached 100% in determinate mode
}
} else {
$bar->incValue();
}
/** rule to decide when to switch back to determinate mode
* - after two full loops and half one
*/
if ($bar->isIndeterminate()) {
if ($loop == 2 && $bar->getValue() == 50) {
$bar->setIndeterminate(false);
$bar->setString(null);
// display % string
示例6:
<?php
require_once 'HTML/Progress.php';
$bar = new HTML_Progress();
$bar->setValue(18);
printf('direct way: progress completed at %f <br/>', $bar->getPercentComplete());
$dm =& $bar->getDM();
printf('another way: progress completed at %f <br/>', $dm->getPercentComplete());
示例7:
<?php
@(include '../include_path.php');
/**
* Basic Vertical ProgressBar example.
*
* @version $Id: basic.php,v 1.1 2004/07/05 21:32:31 farell Exp $
* @author Laurent Laville <pear@laurent-laville.org>
* @package HTML_Progress
*/
require_once 'HTML/Progress.php';
$bar = new HTML_Progress(HTML_PROGRESS_BAR_VERTICAL);
$bar->setAnimSpeed(100);
$bar->setValue(85);
?>
<html>
<head>
<title>Basic Vertical ProgressBar example</title>
<style type="text/css">
<!--
<?php
echo $bar->getStyle();
?>
body {
background-color: #FFFFFF;
color: #000000;
font-family: Verdana, Arial;
}
a:visited, a:active, a:link {
示例8:
$ui->setOrientation(HTML_PROGRESS_BAR_VERTICAL);
$ui->setCellAttributes('active-color=#3874B4 inactive-color=#EEEECC width=65');
?>
<head>
<title>display example</title>
<style type="text/css">
<!--
<?php
echo $bar->getStyle();
?>
// -->
</style>
<script type="text/javascript">
<!--
<?php
echo $bar->getScript();
?>
//-->
</script>
</head>
<body>
<h1>Screenshot </h1>
<?php
$bar->setValue(65);
echo $bar->toHtml();
$bar->display();
?>
</body>
</html>