| Form::Factory::Interface::HTML - Simple HTML form interface |
Form::Factory::Interface::HTML - Simple HTML form interface
version 0.014
use Form::Factory;
my $q = CGI->new; my $html = '<form>';
my $form = Form::Factory->new(HTML => { renderer => sub { $html .= join('', @_) }, consumer => sub { shift->Vars }, });
my $action = $form->new_action('MyApp::Action::Foo'); $action->consume_and_clean_and_check_and_process( request => $q ); $action->render;
$html .= '</form>';
print $q->header('text/html'); print $html;
This renders plain HTML forms and consumes value from a hash.
This is a code reference responsible for printing the HTML elements. The HTML for the controls is passed to this subroutine as a string. The default implementation just prints to the screen.
sub { print @_ }
This is a code reference responsible for taking the request object and turning it into a hash reference of values passed in from the HTTP request. The value passed in is the value passed as the request parameter to consume in the Form::Factory::Action manpage.
Returns a the Form::Factory::Interface::HTML::Widget manpage implementation for the given control.
Returns a widget for a the Form::Factory::Control::Button manpage.
Returns a widget for a the Form::Factory::Control::Checkbox manpage.
Returns a widget for a the Form::Factory::Control::FullText manpage.
Returns a widget for a the Form::Factory::Control::Password manpage.
Returns a widget for a the Form::Factory::Control::SelectMany manpage.
Returns a widget for a the Form::Factory::Control::SelectOne manpage.
Returns a widget for a the Form::Factory::Control::Text manpage.
Returns a widget for a the Form::Factory::Control::Value manpage.
Renders the widget for the given control.
Consumes values using the widget for the given control.
When I initially implemented this, using the widget classes made sense. However, the API has changed in some subtle ways since then. Originally, widgets were a required piece of the factory API, but they are not anymore. As such, they don't make nearly as much sense as they once did.
They will probably be removed in a future release.
the Form::Factory::Interface manpage
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
Copyright 2009 Qubling Software LLC.
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.
| Form::Factory::Interface::HTML - Simple HTML form interface |