HTML::FormFu::Validator(3pm) User Contributed Perl Documentation HTML::FormFu::Validator(3pm)NAME
HTML::FormFu::Validator - Validator Base Class
SYNOPSIS DESCRIPTION METHODS CORE VALIDATORS BEST PRACTICES
Try to avoid using callbacks if possible. Below is a more maintainable and reusable approach, which also keeps the code out of the
controller.
A normal application's directory would contain:
lib/HTML/FormFu/Constraint/MyApp/
lib/HTML/FormFu/Validator/MyApp/
lib/HTML/FormFu/Plugin/MyApp/
etc.
Then, the form config file would just need:
validator: 'MyApp::SomeValidator'
And the class would be something like this:
package HTML::FormFu::Validator::MyApp::SomeValidator;
use strict;
use warnings;
use base 'HTML::FormFu::Validator';
sub validate_value {
my ( $self, $value, $params ) = @_;
my $c = $self->form->stash->{context};
return 1 if $c->model('DBIC')->is_valid($value);
# assuming you want to return a custom error message
# which perhaps includes something retrieved from the model
# otherwise, just return 0
die HTML::FormFu::Exception::Validator->new({
message => 'custom error message',
});
}
1;
HTML::FormFu::Validator::Callback
AUTHOR
Carl Franks, "cfranks@cpan.org"
LICENSE
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2011-05-10 HTML::FormFu::Validator(3pm)
Check Out this Related Man Page
Catalyst::Helper::HTML::FormFu(3pm) User Contributed Perl Documentation Catalyst::Helper::HTML::FormFu(3pm)NAME
Catalyst::Helper::HTML::FormFu - Helper to deploy HTML::FormFu template files.
SYNOPSIS
script/myapp_create.pl HTML::FormFu
DESCRIPTION
As of version 0.02000, HTML::FormFu doesn't use the TT template files by default - it uses in internal rendering engine.
If you don't want to customise the generated markup, you don't need to use Catalyst::Helper::HTML::FormFu at all.
If you want to customise the generated markup, you'll need a local copy of the template files. To create the files in the default
"root/formfu" directory, run:
script/myapp_create.pl HTML::FormFu
To create the files in a different subdirectory of "root", pass the path as an argument. The following example would create the template
files into the directory "root/forms".
script/myapp_create.pl HTML::FormFu forms
You'll also need to tell HTML::FormFu to use the TT renderer, this can be achieved with Catalyst::Controller::HTML::FormFu, with the
following Catalyst application YAML config:
---
'Controller::HTML::FormFu':
constructor:
render_method: tt
SUPPORT
IRC:
Join #catalyst on irc.perl.org.
Mailing Lists:
http://lists.rawmode.org/cgi-bin/mailman/listinfo/html-widget
SEE ALSO
HTML::FormFu, Catalyst::Helper
AUTHOR
Carl Franks, "cfranks@cpan.org"
LICENSE
This library is free software . You can redistribute it and/or modify it under the same terms as perl itself.
perl v5.14.2 2011-04-04 Catalyst::Helper::HTML::FormFu(3pm)
Man Page
3 More Discussions You Might Find Interesting
1. Post Here to Contact Site Administrators and Moderators
I have to suggest that we turn HTML back off. The problem is that angle brackets are used in code and this is causing stuff to get dropped from posts.
I know that we can use the constructs that PxT mentions in this thread. But look how hard it is to educate folks about code tags and the search... (4 Replies)
Hi,
I was compiling few C programs in the unix server and getting the following error message
rm: /home/a0xxx28/AVT/SEEDLIBRARYDB/LIB/*.a non-existent
proc MODE=ANSI CODE=ANSI_C INCLUDE=/home/a0xxx28/PVT/SEEDLIBRARYDB/INCLUDE
INCLUDE=/home/a0xxx28/PVT/SEEDLIBRARY/INCLUDE ... (1 Reply)
Hello,
Is it possible to run/open a HTML File from bash? I mean that when the HTML File contains an alert JavaScript code that then a message box will be shown?
Thanks! (3 Replies)