An implementation of the ezcTreeVisitor interface that generates an XHTML representatation of a tree structure.
Shows (something like):
Source for this file: /Tree/src/visitors/xhtml.php
Version: | //autogentag// |
protected array(string=>array(string)) |
$edges
= array()
Holds all the edges of the graph. |
public ezcTreeVisitorXHTMLOptions |
$options
Holds the options for this class |
protected string |
$root
= null
Holds the root ID. |
public ezcTreeVisitorXHTML |
__construct(
[ $options
= null] )
Constructs a new ezcTreeVisitorXHTML visualizer. |
protected string |
doChildren(
$id
, [ $level
= 0] , [ $levelLast
= array()] )
Loops over the children of the node with ID $id. |
protected string |
formatData(
$data
, $highlight
)
Formats a node's data. |
protected void |
formatPath(
$child
)
Formats the path to the node |
public bool |
visit(
$visitable
)
Visits the node and sets the the member variables according to the node type and contents. |
Constructs a new ezcTreeVisitorXHTML visualizer.
Name | Type | Description |
---|---|---|
$options |
ezcTreeVisitorXHTMLOptions |
Loops over the children of the node with ID $id.
This methods loops over all the node's children and adds the correct layout for each node depending on the state that is collected in the $level and $levelLast variables.
Name | Type | Description |
---|---|---|
$id |
string | |
$level |
int | |
$levelLast |
array(int=>bool) |
Formats a node's data.
It is just a simple method, that provide an easy way to change the way on how data is formatted when this class is extended. The data is passed in the $data argument, and whether the node should be highlighted is passed in the $highlight argument.
Name | Type | Description |
---|---|---|
$data |
mixed | |
$highlight |
bool |
Formats the path to the node
Name | Type | Description |
---|---|---|
$child |
array |
Visits the node and sets the the member variables according to the node type and contents.
Name | Type | Description |
---|---|---|
$visitable |
ezcTreeVisitable |
Method | Description |
---|---|
ezcTreeVisitor::visit() |
Visit the $visitable. |