| HTML-Template-Compiled documentation | Contained in the HTML-Template-Compiled distribution. |
HTML::Template::Compiled::Plugin::DHTML - Dumps variables into clickable HTML output
use HTML::Template::Compiled::Plugin::DHTML;
my $htc = HTML::Template::Compiled->new(
plugin => [qw(HTML::Template::Compiled::Plugin::DHTML)],
...
);
gets called by HTC
Dumps variables into clickable HTML. See dhtml.html in examples.
| HTML-Template-Compiled documentation | Contained in the HTML-Template-Compiled distribution. |
package HTML::Template::Compiled::Plugin::DHTML; # $Id: DHTML.pm 854 2006-11-20 19:02:33Z tinita $ use strict; use warnings; our $VERSION = "0.02"; use Data::TreeDumper; use Data::TreeDumper::Renderer::DHTML; HTML::Template::Compiled->register(__PACKAGE__); sub register { my ($class) = @_; my %plugs = ( escape => { DHTML => \&dumper, }, ); return \%plugs; } sub dumper { my ($var) = @_; my $style; my $body = DumpTree($var, 'Data', DISPLAY_ROOT_ADDRESS => 1, DISPLAY_PERL_ADDRESS => 1, DISPLAY_PERL_SIZE => 1, RENDERER => { NAME => 'DHTML', STYLE => \$style, BUTTON => { COLLAPSE_EXPAND => 1, SEARCH => 1, } } ); return $style.$body; } 1; __END__