Amon2-Plugin-Web-FormValidator-Simple

 view release on metacpan or  search on metacpan

README.pod  view on Meta::CPAN

        if ($c->form->has_error) {
            return $c->render('error.tt');
        }

        ...
    };

    # same as C::P::FV::S, you can use messages/messages.yml

    # development.pl
    ...

    +{
        ...

        validator => +{
            message_format => '<p>%s</p>',
            message_decode_from => 'UTF-8',
            # messages => 'messages.yml',
            messages => +{
                account => +{
                    team => +{
                        NOT_BLANK => 'TEAM cannot be blank!',
                        LENGTH => 'TEAM length must be [1, 10]',
                    },
                    name => +{
                        NOT_BLANK => 'NAME cannnot be blank!',
                        LENGTH => 'NAME length must be [1, 10]',
                    },
                },
            },
        },
    };

    # messages.yml

    account:
        team:
            NOT_BLANK: TEAM cannot be blank!
            LENGTH: TEAM length must be [1, 10]
        name:
            NOT_BLANK: NAME cannot be blank!
            LENGTH: NAME length must be [1, 10]

=head1 DESCRIPTION

Amon2::Plugin::Web::FormValidator::Simple is a port of
L<Catalyst::Plugin::FormValidator::Simple>.
This module has the same methods and options, so see her documents.

=head1 METHODS

=over 4

=item C<< $c->init() >>

initial setup.

=item C<< $c->form() >>

validate form/query parameters.

=item C<< $c->set_invalid_form() >>

set error from manual validation.

=back

=head1 AUTHOR

JINNOUCHI Yasushi E<lt>delphinus@remora.cxE<gt>

=head1 SEE ALSO

L<Amon2::Web>
L<FormValidator::Simple>
L<Catalyst::Plugin::FormValidator::Simple>

=head1 LICENSE

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.


=cut



( run in 0.560 second using v1.01-cache-2.11-cpan-39bf76dae61 )