HTML::...:Simple(3pm)
π NAME π
HTML::FormHandler::Render::Simple β literally the simple rendering role, bestie. That's the whole vibe.
Oh and hey, it's a 3pm man page (Perl module docs, iykyk) π
β¨ VERSION β¨
version 0.40068 β yes queen, that's the version π
πΈ SYNOPSIS πΈ
Okay so first things first: this is a Moose role that's basically the "hello world" of rendering routines for HTML::FormHandler. It lives here as a living example of how to write your own custom renderer all in one package β that's the move if you'd rather do that than use the widgets. π¦
Real talk though: it won't always get updated with improvements by default, because keeping the rendering updated in multiple places was becoming a lot of work. Not me saying that, the docs said it π
So if you've made and modified a 'MyApp::Form::Renderer', in your Form class you go:
package MyApp::Form::Silly;
use Moose;
extends 'HTML::FormHandler::Model::DBIC';
with 'MyApp::Form::Renderers';
And in a template:
[% form.render %]
The widgets get rendered with $field->render; rendering routines from a class like this use $form->render_field('field_name') to render individual fields:
[% form.render_field( 'title' ) %]
π DESCRIPTION π
This role is giving HTML output routines for the 'widget' types defined in the provided FormHandler fields. Every 'widget' name has a 'widget_$name' method here. Periodt. β¨
These widget routines output strings with HTML that's suitable for displaying form fields. Slay.
The widget for a particular field can be defined in the form β and you can create additional widget routines in your form for custom widgets, if you're feeling main character energy π
The fill-in-form values (aka 'fif') are cleaned with the 'render_filter' method of the base field class. You can change that filter to suit your own needs: see HTML::FormHandler::Manual::Rendering π§
π render π
To render all the fields in a form in sorted order (using the 'sorted_fields' method). Iconic behavior honestly.
π¦ render_start, render_end π¦
These use the methods in HTML::FormHandler::Widget::Form::Simple now. If you want to customize them, copy them to your own package. That's the assignment, bestie π«Ά
They'll render the beginning and ending <form> tags and fieldsets. It allows for easy splitting up of the form if you want to hand-render some of the fields:
[% form.render_start %]
[% form.render_field('title') %]
<insert specially rendered field>
[% form.render_field('some_field') %]
[% form.render_end %]
π render_field π
Render a field by passing in a field object or a field name:
$form->render_field( $field )
$form->render_field( 'title' )
β render_text β
Output an HTML string for a text widget π
π render_password π
Output an HTML string for a password widget π
π render_hidden π
Output an HTML string for a hidden input widget
π render_select π
Output an HTML string for a 'select' widget, single or multiple
π render_checkbox π
Output an HTML string for a 'checkbox' widget
π render_radio_group π
Output an HTML string for a 'radio_group' selection widget. Heads up though: this widget should be for a field that inherits from 'Select', since it requires the existence of an 'options' array. No options array, no party π«
π§ render_textarea π§
Output an HTML string for a textarea widget
π₯ render_compound π₯
Renders field with 'compound' widget
π render_submit π
Renders field with 'submit' widget
π«Ά AUTHOR π«Ά
FormHandler Contributors β see HTML::FormHandler π
πΈ 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.
And that's the whole page, bestie! β¨ This lil doc was built with perl v5.34.0 and dated 2022-03-25 β like, that's the source and version and date all up in the footer, so now you know ππ
π¦ where this page comes from
- debian bookworm: libhtml-formhandler-perl 0.40068-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libhtml-formhandler-perl 0.40068-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-formhandler-perl 0.40068-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhtml-formhandler-perl 0.40068-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms