Template::AutoFilter(3pm)

Template::AutoFilter3pm

Template::toolkit with automatic filtering

Usage

    use Template::AutoFilter;
    my $templ = "[% str %]  [% str | none %]  [% str | url %]";
    my $out;
    Template::AutoFilter->new->process( \$templ, { str => '<a>' }, \$out );
    print $out; # "&lt;a&gt;  <a>  %3Ca%3E"
    my $out;
    Template::AutoFilter->new( AUTO_FILTER => 'upper' )->process( \$templ, { str => '<a>' }, \$out );
    print $out; # "<A>  <a>  %3Ca%3E"

Version

version 0.143050

Overview

Template::AutoFilter is a subclass of Template::Toolkit which loads a specific Parser that is subclassed from Template::Parser. It adds a filter instruction to each interpolation token found in templates loaded by the TT engine. Tokens that already have a filter instruction are left unchanged.

By default this automatic filter is set to be 'html', but can be modified during object creation by passing the AUTO_FILTER option with the name of the wanted filter.

Additionally a pass-through filter called 'none' is added to the object to allow exclusion of tokens from being filtered.

Lastly, if you have problems with the directives which get auto filters applied, you can see the Template::AutoFilter::Parser docs for how you can customize that.

WARNING: This module is highly experimental. I have not done a lot of testing and things might blow up in unexpected ways. The API and behavior might change with any release (until 1.0). If you'd like to see any changes implemented, let me know via RT, email, IRC or by opening a pull request on github.

Use at your own risk.

Methods

new

Pre-processes the parameters passed on to Template's new(). Adds the pass-through filter and creates the AutoFilter Parser.

All parameters passed to this new() will also be passed to the parser's new().

Contributors

Ryan Olson (cpan:GIMPSON) <[email protected]>

Aran Deltac (cpan:BLUEFEET) <[email protected]>

Thomas Sibley (cpan:TSIBLEY) <[email protected]>

Support

Bugs / Feature Requests

Please report any bugs or feature requests through the issue tracker at <http://rt.cpan.org/Public/Dist/Display.html?Name=Template-AutoFilter>. You will be notified automatically of any progress on your issue.

Source Code

This is open source software. The code repository is available for public review and contribution under the terms of the license.

<https://github.com/wchristian/Template-AutoFilter>

  git clone https://github.com/wchristian/Template-AutoFilter.git

Releases

5 releases since Debian 9 (Stretch); the text changed 2 times.

  1. 9–10
  2. 11
  3. 12–13

Author

Christian Walde <[email protected]>

From libtemplate-autofilter-perl 0.143050-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.