NAME

Data::MuForm::Manual::Transformations - Transformation of field inputs and values

VERSION

version 0.01

SYNOPSIS

Manual Index

Various transformations on the input and value.

DESCRIPTION

In order to understand which transform you want to use, it helps to understand how data is moved in MuForm.

Data from the 'model' or 'init_values' initially fills in the field 'value' attributes. If there are params/data to be be processed, they fill in the 'input' attributes. When validation is performed, the input is copied to the value.

Transforms

There are a number of methods to provide finely tuned transformation of the input or value.

transform_param_to_input

Transform the param when it's copied into 'input'. Will change what the user sees in a re-presented form.

transform_input_to_value

Transforms the string that when it's copied from 'input' to 'value' during validation.

(In FH was 'inflate_method'.)

transform_value_to_fif

The 'fif' (fill-in-form) values is used in rendering. If the form was submitted with params, the 'input' is used for 'fif', but when there is no input, the 'value' is used. This happens when the form is initially presented and has been filled with values from the 'model', 'init_values', or the field 'default'. This transforms the 'value' to a string suitable for filling in a form field.

(In FH was 'deflate_method'.)

transform_default_to_value

Transform the 'default' provided by an 'model' or 'init_values' or 'default' when it's stored in the 'value'.

(In FH was inflate_default_method.)

transform_value_after_validate

Transform the value after validation has been performs, in order to return a different form in $form->value.

(In FH was 'deflate_value_method'.)

trim

A transform to trim the field. The default 'trim' sub strips beginning and trailing spaces. Set this attribute to null to skip trimming, or supply a different sub. This method is called right after 'transform_input_to_value'.

Transform during validation

You can also transform during validation, in a field validation sub or in an 'apply' action. There is a 'transform' flavor of apply action. See the Data::MuForm::Manual::Validation.

AUTHOR

Gerda Shank

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Gerda Shank.

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

1 POD Error

The following errors were encountered while parsing the POD:

Around line 83:

You forgot a '=back' before '=head2'