HTML::FormHandler::Field::Display
This class can be used for fields that are display only. It will render the value returned by a form's 'html_<field_name>' method, or the field's 'html' attribute.
has_field 'explanation' => ( type => 'Display', html => '<p>This is an explanation...</p>' );
or in a form:
sub html_explanation { my ( $self, $field ) = @_; if( $self->something ) { return '<p>This type of explanation...</p>'; } else { return '<p>Another type of explanation...</p>'; } }
or set the name of the rendering method:
has_field 'explanation' => ( type => 'Display', set_html => 'my_explanation' ); sub my_explanation { .... }
To install HTML::FormHandler, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::FormHandler
CPAN shell
perl -MCPAN -e shell install HTML::FormHandler
For more information on module installation, please visit the detailed CPAN module installation guide.