HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]
Prev Next

setBorderAttributes Manual

defines look and feel of the progress bar border

by by Laurent Laville
mailto:pear@laurent-laville.org
November 2003, Laurent Laville
(HTML_Progress 1.0+)

Synopsis

void setBorderAttributes( $attributes )

Attributes

Name Type Default
attributes  array  
  • class => progressBarBorder   
  • width => 0   
  • style => solid (dashed, dotted, inset, outset)   
  • color => #000000   

$attributes is an associative array or string of HTML tag attributes.

Description

The setBorderAttributes() method is used to give a look and feel, such as size, style and color, to the progress bar border.

You may also used an existing StyleSheet and a CSS class-selector with pre-defined style. For example:

  1. <?php
  2. ...
  3. // specify a user-ident (instead of the auto-generated value)
  4. $bar->setIdent('PB1');  
  5. ...
  6. $ui =$bar->getUI();
  7. $ui->setBorderAttributes('class="myProgressBorder"');
  8. ...
  9. ?>
<!-- custom stylesheet -->
...
.PB1 .myProgressBar { border: 3px dotted #0000FF; }
...
   

Example

Example below will produced a progress bar with a solid navy border. It's a static example, the progress bar will not run.

  1. <?php
  2. require_once ('HTML/Progress.php');
  3.  
  4. $bar = new HTML_Progress();
  5. $bar->setBorderPainted(true);
  6.  
  7. $ui =$bar->getUI();
  8. $ui->setCellAttributes('active-color=#3874B4 inactive-color=#EEEECC width=10');
  9. $ui->setBorderAttributes('width=1 color=navy');
  10. $ui->setStringAttributes('width=60 font-size=14 background-color=#EEEEEE');
  11.  
  12. ?>
  13. <!DOCTYPE html
  14.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  15.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  16.  
  17. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  18. <head>
  19. <title>ProgressBar </title>
  20. <style type="text/css">
  21. <!--
  22. <?php echo $bar->getStyle()?>
  23. // -->
  24. </style>
  25. <body>
  26.  
  27. <?php echo $bar->toHtml()?>
  28.  
  29. </body>
  30. </html>

See Also

To display the progress bar border, take care that setBorderPainted Manual method was also invoked.

Prev   Next
setBorderPainted Manual setCellCount Manual

Documentation generated on Mon, 11 Mar 2019 10:15:06 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.