HTML::...Display(3pm)

πŸ“¦
version 0.40068 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute

okay bestie, this is the HTML::...Display(3pm) page β€” a User Contributed Perl Documentation moment β€” and it's all about HTML::FormHandler::Field::Display, the display-only field. Ngl, it's giving β€œlook cute, don't submit anything” energy πŸ’…βœ¨

🌸 NAME 🌸

HTML::FormHandler::Field::Display β€” a display only field. That's it, that's the whole name section, periodt. πŸŽ€

πŸ¦‹ VERSION πŸ¦‹

version 0.40068 β€” noted, bestie. no cap. ⭐

✨ SYNOPSIS ✨

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. Lowkey iconic: the display field just shows the tea. πŸ”₯

Here's the simplest vibe β€” set the html attribute:

  has_field 'explanation' => ( type => 'Display',
     html => '<p>This is an explanation...</p>' );

or in a form, let the form's html_<field_name> method decide what to render:

  has_field 'explanation' => ( type => 'Display' );
  sub html_explanation {
     my ( $self, $field ) = @_;
     if( $self->something ) {
        return '<p>This type of explanation...</p>';
     }
     else {
        return '<p>Another type of explanation...</p>';
     }
  }
  #----
  has_field 'username' => ( type => 'Display' );
  sub html_username {
      my ( $self, $field ) = @_;
      return '<div><b>User:&nbsp;</b>' . $field->value . '</div>';
  }

or set the name of the rendering method with set_html:

   has_field 'explanation' => ( type => 'Display', set_html => 'my_explanation' );
   sub my_explanation {
     ....
   }

or provide a render_method:

   has_field 'my_button' => ( type => 'Display', render_method => \&render_my_button );
   sub render_my_button {
       my $self = shift;
       ....
       return '...';
   }
bestie, every one of those is a way to tell the display field what to render. that's the whole assignment. πŸ’–

πŸ‘‘ AUTHOR πŸ‘‘

FormHandler Contributors - see HTML::FormHandler. πŸ’œ

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. 🫢


mwah πŸ’‹ this page's source/version is perl v5.34.0, dated 2022-03-25, and the page title is HTML::...Display(3pm). bye bestie, go render something cute πŸŒˆπŸ’…

πŸ“¦ where this page comes from