setStringAttributes Manual
defines look and feel of the progress bar string
Synopsisvoid setStringAttributes( $attributes )
AttributesName |
Type |
Default |
attributes |
array |
- id => installationProgress
- width => 50
- font-family => Verdana, Arial, Helvetica, sans-serif
- font-size => 12
- color => #000000
- background-color => #FFFFFF
- align => right ( left, center )
- for horizontal bar:
- valign => right (left, top, bottom)
- for vertical bar:
- valign => bottom (top, left, right)
|
$attributes is an associative array or string of HTML tag attributes.
DescriptionThe setStringAttributes() method is used to give a look and feel,
such as alignment, size and color, to the progress bar string.
You may also used an existing StyleSheet and a CSS id with pre-defined style.
For example:
<?php
require_once ('HTML/Progress.php');
$bar = new HTML_Progress();
// specify a user-ident (instead of the auto-generated value)
$bar->setIdent('myPB');
$bar->setStringPainted(true);
$ui =& $bar->getUI();
$ui->setStringAttributes('id="myPBstring"');
...
?>
|
<!-- custom stylesheet -->
...
.myPB .myPBstring { width: 100px; background-color: lightyellow; color: black; }
...
|
ExampleExample below will produced a progress bar with a custom style string. It's a static example,
the progress bar will not run.
<?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(); ?>
//-->
</script>
</head>
<body>
<?php
echo $bar->toHtml();
$bar->display();
?>
</body>
</html>
See AlsosetStringPainted Manual
Prev |
Up |
Next |
getStringAttributes Manual |
Reference Guides |
getBorderAttributes Manual |
Documentation generated on Mon, 11 Mar 2019 13:52:35 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|