PET::Filter

Base class for all Filter modules.

Filter modules are run BEFORE the templates are processed, so that they can modify the templates before they are processed.  Using an md5 hash, .pet files are modified and stored in the “cache” directory as “PRE_$md5hash.comp”.

To switch on a Filter module, you have to list it in global.conf, at general.template.filter, such as

<general>
 <template>
  filters = PET::Filter::PreMultiLang PET::Filter::UtilXmlMap
  ...

Usually you want to load PET::Filter::General in the chain at the first place.  Filters are run in the order they appear in global.conf.  You can of course write your own filters, too.

Summary
PET::FilterBase class for all Filter modules.
Variables
$DispExported on-demand, this is the main instance of PET::Dispatcher.
$LogThis is of course PET::Log, exported on-demand.
$UtilThis is the main UTIL namespace, exported on-demand.
Functions
new($DISP_in)Constructor for a filter.
initNot used by default, but called from “new” in case you needed it.

Variables

$Disp

our $Disp

Exported on-demand, this is the main instance of PET::Dispatcher.

$Log

our $Log

This is of course PET::Log, exported on-demand.

$Util

our $Util

This is the main UTIL namespace, exported on-demand.

Functions

new($DISP_in)

sub new

Constructor for a filter.  Only need $DISP_in, the main PET::Dispatcher instance.

Parameters

$DISP_inthe main instance of PET::Dispatcher.

init

sub init

Not used by default, but called from “new” in case you needed it.

This Filter should be the first one in the chain.
This filter is used to generate HTML-tags and markup from various textual markups at precompile time.
This is a special multilangual module.
This filter is used to map xml-like tags to PET::Util method calls.
our $Disp
Exported on-demand, this is the main instance of PET::Dispatcher.
our $Log
This is of course PET::Log, exported on-demand.
General logger class used by PET.
our $Util
This is the main UTIL namespace, exported on-demand.
sub new
Constructor for a filter.
sub init
Not used by default, but called from “new” in case you needed it.
Close