Hyper::Control::Base::BTree - Tree Base Control
This document describes Hyper::Control::Base::BTree 0.02
use Hyper::Control::Base::BTree; my $object = Hyper::Control::Base::BTree->new();
Base Control for HTML Trees.
my $child = Hyper::Control::Base::BTree->new(); $child->set_data('this is a nice child'); $object->add_child($child);
Add a child to a tree object. Childs are Tree Objects too.
my $has_childs = $object->has_childs();
Indicates if a tree has childs.
my $has_next_sibling = $object->has_next_sibling();
Indicates if a tree object has a next siblings.
my $has_previous_sibling = $object->has_previous_sibling();
Indicates if a tree object has a previous siblings.
my $is_root = $object->is_root();
Indicates if a tree object has no parent node / if it's the root tree object.
my $html = $object->get_html();
Adjust $HTML::Template::Compiled::MAX_RECURSE and returns the rendered template.
my $template_childs = $object->get_template_childs();
Some Template engines are very stupid. This method is a helper method which returns all childs of a tree object as an array of hash refs which look like [ { this => $child[0] }, { this => $child[1] }, ... ]
If you don't understand what I mean, take a closer look on the default HTC template of for this Control.
version
Hyper::Control::Base
Class::Std::Storable
$Author: ac0v $
$Id: BTree.pm 526 2008-12-23 07:38:23Z ac0v $
$Revision: 526 $
$Date: 2008-12-23 08:38:23 +0100 (Di, 23 Dez 2008) $
$HeadURL: http://svn.hyper-framework.org/Hyper/Hyper/trunk/lib/Hyper/Control/Base/BTree.pm $
Andreas Specht <ACID@cpan.org>
<ACID@cpan.org>
Copyright (c) 2007, Andreas Specht <ACID@cpan.org>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Hyper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Hyper
CPAN shell
perl -MCPAN -e shell install Hyper
For more information on module installation, please visit the detailed CPAN module installation guide.