HTML::...:Simple(3pm)

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

πŸ’– 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 πŸ’–


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