Previous Next
XMLTagClass

Container

This is the base class for all of phpHtmlLib

by Walter A. Boring IV
© September 2005, Walter A. Boring IV
(phpHtmlLib 2.5.4)

Description

This class is nothing more then a container widget. It lets you push data into it, and it will render each item indented properly so it works with the rest of the libs.

This is helpfull when you have a function that wants to return multiple Tag Objects or widgets. Just wrap them in this container and they will all get rendered with the current indentation level.

Example

  $c = container('this is a', html_b('test') );
  $c->add( html_br() );
  print $c->render();

Constructor call

This lets you pass in data that you want automatically added to the container. You can add as man items in the call the constructor. Then you can use the add() method to add more items later.

$c = container('this is a', html_b('test'));

add Method

This lets you add new data to the container. You can pass in strings, integers and other Container child objects that implement the render() method.

$c = container();
$c->add('testing', 1, 2, 3);

The output:

testing
1
2
3

Collapse

This method is used to force the output to exist on 1 line, instead of a newline for every element added.

$c = container();
$c->set_collapse();
$c->add('testing', 1, 2, 3);

The output:

testing123

Previous Next
XMLTagClass

Documentation generated on Fri, 28 Jan 2011 08:52:35 -0500 by phpDocumentor 1.4.3