Template::Plugin::StickyQuery - TT plugin for HTML::StickyQuery


Template-Plugin-StickyQuery documentation Contained in the Template-Plugin-StickyQuery distribution.

Index


Code Index:

NAME

Top

Template::Plugin::StickyQuery - TT plugin for HTML::StickyQuery

SYNOPSIS

Top

  use Template;
  use Apache;
  use Apache::Request;

  my $apr      = Apache::Request->new(Apache->request); # or CGI.pm will do
  my $template = Template->new( ... );
  $template->process($filename, { apr => $apr });

  # in your template
  [% USE StickyQuery %]
  [% FILTER stickyquery param => apr %]
  <A HREF="go.cgi?page=&foo=&bar">go</A>
  [% END %]

DESCRIPTION

Top

Template::Plugin::StickyQuery is a plugin for TT, which allows you to make your HTML tag sticky using HTML::StickyQuery.

Special thanks to IKEBE Tomohiro.

AUTHOR

Top

Hiroyuki Kobayasi <kobayasi@piano.gs>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Top

Template, HTML::StickyQuery


Template-Plugin-StickyQuery documentation Contained in the Template-Plugin-StickyQuery distribution.

package Template::Plugin::StickyQuery;

use strict;
use vars qw($VERSION);
$VERSION = 0.01;

require Template::Plugin::Filter;
use base qw(Template::Plugin::Filter);

use vars qw($DYNAMIC $FILTER_NAME);
$DYNAMIC = 1;
$FILTER_NAME = 'stickyquery';

use HTML::StickyQuery;

sub init {
    my $self = shift;
    my $name = $self->{_ARGS}->[0] || $FILTER_NAME;
    $self->install_filter($name);
    return $self;
}

sub filter {
    my($self, $text, $args, $config) = @_;
    my $sticky = HTML::StickyQuery->new(%$config);
    return $sticky->sticky(scalarref => \$text,
			   param => $config->{param});
}


1;
__END__