| HTML-TagCloud-Sortable documentation | view source | Contained in the HTML-TagCloud-Sortable distribution. |
HTML::TagCloud::Sortable - A sortable HTML tag cloud
my $cloud = HTML::TagCloud::Sortable->new;
# old HTML::TagCloud style
$cloud->add( 'foo', $url, 10 );
# new HTML::TagCloud::Sortable style
$cloud->add( { name => 'foo', url => $url, count => 10, bar => 'baz' } );
# old style
print $cloud->html( 4 );
# new style
print $cloud->html( { limit => 4, sort_field => 'count', sort_type => 'numeric' } );
HTML::TagCloud::Sortable is an API-compatible subclass of HTML::TagCloud. However, by using a different API, you can gain two features:
An overridden construtor. Takes the same arguments as HTML::TagCloud.
Adds the hashref of data to the list of tags. NB: Insertion order is
maintained. At the minimum, you will need to supply name, url and
count key-value pairs.
Brian Cassidy <bricas@cpan.org>
Copyright 2007-2009 by Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| HTML-TagCloud-Sortable documentation | view source | Contained in the HTML-TagCloud-Sortable distribution. |