本文整理汇总了PHP中HTML_Progress::setString方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Progress::setString方法的具体用法?PHP HTML_Progress::setString怎么用?PHP HTML_Progress::setString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_Progress
的用法示例。
在下文中一共展示了HTML_Progress::setString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: floor
global $pkg;
$obj->sleep();
$i = floor($progressValue / 10);
if ($progressValue == 100) {
$msg = '';
} else {
$msg = " installing package ({$progressValue} %) ... : " . $pkg[$i];
}
$obj->setString($msg);
}
$bar = new HTML_Progress();
$bar->setAnimSpeed(100);
$bar->setIncrement(5);
$bar->setStringPainted(true);
// get space for the string
$bar->setString('');
// but don't paint it
$bar->setProgressHandler('myFunctionHandler');
$ui =& $bar->getUI();
$ui->setTab(' ');
$ui->setStringAttributes('width=350 align=left');
?>
<html>
<head>
<title>Horizontal String ProgressBar example</title>
<style type="text/css">
<!--
<?php
echo $bar->getStyle();
?>
示例2:
}
}
}
//
// 2. defines the progress meter
//
$meter = new HTML_Progress();
$ui =& $meter->getUI();
$ui->setProgressAttributes(array('background-color' => '#e0e0e0'));
$ui->setStringAttributes(array('color' => '#996', 'background-color' => '#CCCC99'));
$ui->setCellAttributes(array('active-color' => '#996'));
$meter->setAnimSpeed(200);
$meter->setIncrement(10);
$meter->setStringPainted(true);
// get space for the string
$meter->setString("");
// but don't paint it
$meter->setIndeterminate(true);
// progress meter start in indeterminate mode
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>FTP/Progress Observer example</title>
<style type="text/css">
<!--
body {
background-color: #CCCC99;
color: #996;
font-family: Verdana, Arial;
示例3: package
$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();
$msg = " installing package (25 %) ... : Config";
$bar->setString($msg);
$bar->display();
?>
</body>
</html>
示例4: or
/*
Which version of html_progress: (stable)1.1 or (beta)1.2.0 RC1, RC2 or RC3
*/
$version = _methodExists('run') ? 1.2 : 1.1;
$progress = new HTML_Progress();
$observer = new logsUpload();
// prepare the progress meter to logs all upload operations
$progress->addListener($observer);
$progress->setIncrement(10);
$progress->setAnimSpeed(100);
$progress->setIndeterminate(true);
// progress bar run in indeterminate mode
$progress->setStringPainted(true);
// get space for the string
$progress->setBorderPainted(true);
$progress->setString("");
// but don't paint it
if ($version > 1.1) {
// set a progress handler required at least version 1.2.0RC3
$progress->setProgressHandler('myFunctionHandler');
}
$ui =& $progress->getUI();
$ui->setBorderAttributes('width=1 style=inset color=white');
$ui->setCellAttributes(array('active-color' => '#000084', 'inactive-color' => '#3A6EA5', 'width' => 25, 'spacing' => 0, 'background-image' => 'download.gif'));
$ui->setStringAttributes(array('width' => 60, 'font-size' => 10, 'background-color' => '#C3C6C3'));
?>
<!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">
示例5:
<?php
require_once 'HTML/Progress.php';
$bar = new HTML_Progress(HTML_PROGRESS_BAR_VERTICAL);
$bar->setAnimSpeed(80);
$bar->setIdent('PB1');
$bar->setIncrement(10);
$bar->setBorderPainted(true);
$bar->setStringPainted(true);
// get space for the string
$bar->setString("");
// but don't paint it
$bar->setIndeterminate(true);
// progress start in indeterminate mode
$ui =& $bar->getUI();
$ui->setCellAttributes('active-color=#970038 inactive-color=#FFDDAA width=50 height=13');
$ui->setBorderAttributes('width=1 color=#000000');
$ui->setStringAttributes(array('font-size' => 8, 'color' => '#FF0000', 'background-color' => '#C3C6C3', 'align' => 'center', '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>setIndeterminate example</title>
<style type="text/css">
<!--
<?php
echo $bar->getStyle();
?>
示例6:
<?php
require_once 'HTML/Progress.php';
$bar = new HTML_Progress();
$bar->setAnimSpeed(100);
$bar->setIncrement(5);
$bar->setStringPainted(true);
// get space for the string
$bar->setString('');
// but don't paint it
$ui =& $bar->getUI();
$ui->setStringAttributes('width=350 align=left');
?>
<html>
<head>
<title>setString example</title>
<style type="text/css">
<!--
<?php
echo $bar->getStyle();
?>
// -->
</style>
<script type="text/javascript">
<!--
<?php
echo $bar->getScript();
?>
//-->
</script>
</head>