Name

Filter — specify variables and filters through which they should be run through automatically

SYNOPSIS

variable_name filter_name ...

DESCRIPTION

The directive specifies one or more filters that should automatically be applied to CGI variables.

That way, by the time you get to call [cgi], the variable value is already filtered and ready for use.

DIRECTIVE TYPE AND DEFAULT VALUE

Catalog directive

EXAMPLES

Example: Automatically filtering "mail_lists" variable

Some variables submitted by the user come back null-separated, such as values from multi-select boxes where the selected items are separated by null (\0) characters. To automatically change those nulls to spaces, you could use this directive:

Filter mail_lists  null_to_space

Example: Applying multiple filters to a variable

Filter firstname  "lc ucfirst"

NOTES

You could also use the [filter] tag, but in the long run the Filter approach reduces typing and minimizes the chance of omission.

AVAILABILITY

Filter is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

Interchange 5.9.0:

Source: lib/Vend/Config.pm
Line 628

['Filter',        'hash',            ''],

Source: lib/Vend/Config.pm
Line 3188 (context shows lines 3188-3205)

sub parse_hash {
my($item,$settings) = @_;
if (! $settings) {
  return $HashDefaultBlank{$item} ? '' : {};
}

my $c;

if(defined $C) {
  $c = $C->{$item} || {};
}
else {
  no strict 'refs';
  $c = ${"Global::$item"} || {};
}

return hash_string($settings,$c);
}

AUTHORS

Interchange Development Group

SEE ALSO

filter(7ic), CodeDef(7ic)

DocBook! Interchange!