Tree::Simple::View::HTML is a Perl class for viewing Tree::Simple hierarchies in HTML.
SYNOPSIS
use Tree::Simple::View::HTML;
## a simple example
# use the defaults (an unordered list with no CSS)
my $tree_view = Tree::Simple::View::HTML->new($tree);
## more complex examples
# use the CSS properties
my $tree_view = Tree::Simple::View::HTML->new($tree => (
list_type => "ordered",
list_css => "list-style: circle;",
list_item_css => "font-family: courier;",
expanded_item_css => "font-family: courier; font-weight: bold",
));
# use the CSS classes
my $tree_view = Tree::Simple::View::HTML->new($tree => (
list_css_class => "myListClass",
list_item_css_class => "myListItemClass",
expanded_item_css_class => "myExpandedListItemClass",
));
# mix the CSS properties and CSS classes
my $tree_view = Tree::Simple::View::HTML->new($tree => (
list_css => "list-style: circle;",
list_item_css => "font-family: courier;",
expanded_item_css_class => "myExpandedListItemClass",
node_formatter => sub {
my ($tree) = @_;
return "" . $tree->getNodeValue()->description() . "";
}
));
# print out the tree fully expanded
print $tree_view->expandAll();
# print out the tree expanded along a given path (see below for details)
print $tree_view->expandPath("Root", "Child", "GrandChild");
Product's homepage
Requirements:
· Perl