Statocles::Link::Tree - A link object with child links, making a tree
version 0.098
my $link = Statocles::Link::Tree->new( href => '/', text => 'Home', children => [ { href => '/blog', text => 'Blog', }, { href => '/projects', text => 'Projects', }, ], );
This class represents a link which is allowed to have child links. This allows making trees of links for multi-level menus.
$link->children([ # Object Statocles::Link::Tree->new( href => '/blog', text => 'Blog', ), # Hashref of attributes { href => '/about', text => 'About', }, # URL only 'http://example.com', ]);
The children of this link. Should be an arrayref of Statocles::Link::Tree objects, hashrefs of attributes for Statocles::Link::Tree objects, or URLs which will be used as the href attribute for a Statocles::Link::Tree object.
Statocles::Link::Tree
href
Statocles::Link
Doug Bell <preaction@cpan.org>
This software is copyright (c) 2016 by Doug Bell.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Statocles, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Statocles
CPAN shell
perl -MCPAN -e shell install Statocles
For more information on module installation, please visit the detailed CPAN module installation guide.