This repository has been archived by the owner on Jan 7, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Unmaintained, please use Tags::HTML::Element::Form
License
michal-josef-spacek/Tags-HTML-Form
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
NAME Tags::HTML::Form - Tags helper for form. SYNOPSIS use Tags::HTML::Form; my $obj = Tags::HTML::Form->new(%params); $obj->process(@fields); $obj->process_css; METHODS "new" my $obj = Tags::HTML::Form->new(%params); Constructor. * "background_color" Form background color. Default value is '#f2f2f2'. * "css" 'CSS::Struct::Output' object for "process_css" processing. Default value is undef. * "button" Tags::HTML::Button instance to process button. Default value is Tags::HTML::Button object with 'tags' and 'css' parameter inherited with main object. * "form" Data object for form. Could be a 'Data::HTML::Form' instance. Default value is instance with 'form' css class. * "input" Tags::HTML::Form::Input instance to process inputs. Default value is Tags::HTML::Form::Input object with 'tags' and 'css' parameter inherited with main object. * "select" Tags::HTML::Form::Select instance to process select elements. Default value is Tags::HTML::Form::Select object with 'tags' and 'css' parameter inherited with main object. * "submit" Data object for submit. Could be a 'Data::HTML::Form::Input' or 'Data::HTML::Button' instance. Default value is instance with 'Save' submit value. * "tags" 'Tags::Output' object for "process" processing. Default value is undef. * "textarea" Tags::HTML::Textarea instance to process textarea elements. Default value is Tags::HTML::Textarea object with 'tags' and 'css' parameter inherited with main object. "process" $obj->process(@fields); Process Tags structure for fields defined in @fields to output. Accepted items in @fields are objects: * Data::HTML::Form::Input * Data::HTML::Textarea Returns undef. "process_css" $obj->process_css; Process CSS::Struct structure for output. Returns undef. ERRORS new(): From Class::Utils::set_params(): Unknown parameter '%s'. From Tags::HTML::new(): Parameter 'css' must be a 'CSS::Struct::Output::*' class. Parameter 'tags' must be a 'Tags::Output::*' class. Parameter 'button' must be a 'Tags::HTML::Button' instance. Parameter 'form' is required. Parameter 'form' must be a 'Data::HTML::Form' instance. Parameter 'form' must define 'css_class' parameter. Parameter 'input' must be a 'Tags::HTML::Form::Input' instance. Parameter 'select' must be a 'Tags::HTML::Form::Select' instance. Parameter 'submit' instance has bad type. Parameter 'submit' is required. Parameter 'submit' must be a 'Data::HTML::Form::Input' instance. Parameter 'textarea' must be a 'Tags::HTML::Textarea' instance. process(): From Tags::HTML::process(): Parameter 'tags' isn't defined. Form item must be a 'Data::HTML::Form::Input' instance. process_css(): From Tags::HTML::process_css(): Parameter 'css' isn't defined. EXAMPLE use strict; use warnings; use CSS::Struct::Output::Indent; use Tags::HTML::Form; use Tags::Output::Indent; # Object. my $css = CSS::Struct::Output::Indent->new; my $tags = Tags::Output::Indent->new; my $obj = Tags::HTML::Form->new( 'css' => $css, 'tags' => $tags, ); # Process form. $obj->process; $obj->process_css; # Print out. print $tags->flush; print "\n\n"; print $css->flush; # Output: # <form class="form" method="GET"> # <p> # <button type="submit"> # Save # </button> # </p> # </form> # # .form { # border-radius: 5px; # background-color: #f2f2f2; # padding: 20px; # } # .form input[type=submit]:hover { # background-color: #45a049; # } # .form input[type=submit] { # width: 100%; # background-color: #4CAF50; # color: white; # padding: 14px 20px; # margin: 8px 0; # border: none; # border-radius: 4px; # cursor: pointer; # } # .form input, select, textarea { # width: 100%; # padding: 12px 20px; # margin: 8px 0; # display: inline-block; # border: 1px solid #ccc; # border-radius: 4px; # box-sizing: border-box; # } # .form-required { # color: red; # } DEPENDENCIES Class::Utils, Data::HTML::Form, Data::HTML::Button, Error::Pure, List::Util, Scalar::Util, Tags::HTML, Tags::HTML::Form::Input, Tags::HTML::Form::Select. REPOSITORY <https://github.com/michal-josef-spacek/Tags-HTML-Form> AUTHOR Michal Josef Špaček <mailto:skim@cpan.org> <http://skim.cz> LICENSE AND COPYRIGHT © 2022-2023 Michal Josef Špaček BSD 2-Clause License VERSION 0.09
About
Unmaintained, please use Tags::HTML::Element::Form
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published