Form::Tiny::Filter - a representation of a filter
# in your form class # the following will be coerced into Form::Tiny::Filter form_filer Str, sub { uc shift() };
This is a simple class which stores a Type::Tiny type and a sub which will perform the filtering.
A Type::Tiny type that will be checked against.
Required.
DEPRECATED
A string name of a field that should be filtered, or undef if this filter should execute for every field in the form.
A code reference accepting a single scalar and performing the filtering. The scalar will already be checked against the type.
Accepts a single string, which is a name of a field. Returns a boolean value, which determines whether this filter should be used for that field.
$filtered = $filter->filter($filtered, @more_params);
Accepts a single scalar, checks if it matches the type and runs the code reference with it as an argument. Can accept more parameters, which will be inserted before the value in the subroutine call (the value is always the last parameter to the coderef).
The return value is the scalar value, either changed or unchanged.
To install Form::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Form::Tiny
CPAN shell
perl -MCPAN -e shell install Form::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.