HTML::FormFu::Library - Library of precompiled HTML::FormFu forms
version 0.002
my $form1 = HTML::FormFu->new(...); my $form2 = HTML::FormFu->new(...); my $model = My::Schema->connect(...); my $query = { param => 'value', ... }; my $library = HTML::FormFu::Library->new( cache => { form1 => $form1, form2 => $form2 }, model => $model, query => $query, ); if ( $library->form('form1')->submitted_and_valid ) { ... }
HTML::FormFu::Library is a module for managing HTML::FormFu forms in a persistent environment, and is meant to be used in conjunction with Catalyst::Model::FormFu. It is constructed with a list of populated form objects, and returns clones of these objects via the form method.
HTML::FormFu::Library
Given the id of one or more forms stored in the cache, clones the form objects, supplies query values, adds a model object to the form stash, processes the form and returns it.
Same as form above, but does not process the forms before returning them. Useful to avoid calling process multiple times when you need to make further modification to the form object.
process
Returns the original form, a clone of which you get when you use form or raw_form. Any changes you make to the state of a cached form will be reflected in all objects produced via subsequent calls to form and raw_form. Do not use unless you know what you are doing.
form
raw_form
Catalyst::Model::FormFu
Peter Shangov <pshangov@yahoo.com>
This software is copyright (c) 2011 by Peter Shangov.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Catalyst::Model::FormFu, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Model::FormFu
CPAN shell
perl -MCPAN -e shell install Catalyst::Model::FormFu
For more information on module installation, please visit the detailed CPAN module installation guide.