CGI-FormBuilder

 view release on metacpan or  search on metacpan

pod/Changes.pod  view on Meta::CPAN


This is used the convert fields on the fly into objects or other
values. For example, you could convert a "date" field into a 
DateTime object. Nice patch from Mark Hedges, check it out.

=head2 Turkish messages

Thanks to Recai Oktas.

=head2 Added "missing" property for fields

This can be queried in templates. To see if a field is missing altogether,
you can check "field.missing" or "missing-field" depending on your
template engine of choice.

=head2 Removal of custom C<puke> and C<belch>

FormBuilder now uses C<Carp> and C<@CARP_NOT> to handle its errors.
As such, you will probably notice some differences in error output.
The benefit is that setting C<debug> will give you a stack trace
on fatal errors.

=head2 CGI::FormBuilder::Template::Builtin

Moved the C<render_builtin()> method to the above module, to
unify the rendering schemes.

=head2 New FORMBUILDER_DEBUG environment variable

Setting this has the same effect as using the C<debug> option.

=head2 Removal of excess documentation

Removed all the stub docs from C<Field::*> and C<Messages::*>
to make CPAN happy.

=head1 VERSION 3.0302

This is a bugfix release to repair these main items:

    - optgroups bugfix for complex arrays
    - removal of HTML::Entities support due to utf8 issues
    - new es_ES Messages module with better translations
    - a patch from Mark Hedges to enable plugin modules for mailresults()

The rest of the features remain the same as below.

=head1 VERSION 3.03

=head2 Subclassable Fields

Each field is now rendered by its own class, named for the field type.
For example, text fields are rendered by C<CGI::FormBuilder::Field::text>.
This allows you to create custom field types and plugging them in by 
creating your own C<CGI::FormBuilder::Field::whatever_you_want> module.
Thanks to Peter Eichman for his contributions to this scheme.

=head2 Messages Localization

All messages are now handled in a similar way to field types: They are
delegated to C<CGI::FormBuilder::Messages::locale> where "locale" is
the appropriate string such as "en_US" or "da_DK". A number of localizations
are included as part of the standard distribution.

There are two ways to use these messages: Either the 'auto' messages
mode or by specifying a specific locale:

    my $form = CGI::FormBuilder->new(messages => 'auto');   # check client
    my $form = CGI::FormBuilder->new(messages => ':da_DK'); # specified

You can create your own messages by copying C<_example.pm> and modifying
it for your language. When using messages in this way, the HTTP Charset
is changed to C<utf-8>.

=head2 Select optgroup support

By using the C<field()> option C<optgroups>, you can now cause select
fields to automatically generate optgroup tags:

    $form->field(name => 'browser', options => \@opt, optgroups => 1);

See the documentation on C<optgroups> for more details.

=head2 Data::FormValidator Support

Thanks to another great patch from Peter Eichman, C<Data::FormValidator>
is supported as a validation option to C<new()>, just by passing it in
as an object. See the documentation on C<validate> for more information.

=head2 Option sorting by LABELNAME or LABELNUM

You can now sort options by C<LABELNAME> or C<LABELNUM>, similar to
the value-based sorting of C<NAME> and C<NUM>. See the documentation
for more details.

=head2 XHTML Compliance

Generated code now validates against L<http://validator.w3.org>.
This includes stuff like lowercase C<get> and C<post> methods, 
lowercase C<onchange> and C<onsubmit> actions, and so on.

=head1 VERSION 3.02

=head2 Multi-Page Form Support

A new module, C<CGI::FormBuilder::Multi>, has been added to handle the
navigation and state of multi-page forms. A multi-page form is actually
composed of several individual forms, tied together with the special
CGI param C<_page>:

    my $multi = CGI::FormBuilder::Multi->new(
                     # first args are hashrefs per-form
                     \%form1_opts,
                     \%form2_opts,
                     \%form3_opts,

                     # remaining options apply to all forms
                     header => 1,
                     method => 'POST',
                );

    my $form = $multi->form;    # current form

    if ($form->submitted && $form->validate) {

        # you write this



( run in 0.853 second using v1.01-cache-2.11-cpan-ceb78f64989 )