Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

html::formfu::validator(3pm) [debian man page]

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

HTML::FormFu::Constraint::CallbackOnce(3pm)		User Contributed Perl Documentation	       HTML::FormFu::Constraint::CallbackOnce(3pm)

NAME
HTML::FormFu::Constraint::CallbackOnce - Code Callback Constraint SYNOPSIS
$form->constraint({ type => 'CallbackOnce', name => 'foo', callback => &sfoo, ); sub foo { my ( $value, $params ) = @_; # return true or false } DESCRIPTION
Unlinke the HTML::FormFu::Constraint::Callback, this callback is only called once, regardless of how many values are submitted. The first argument passed to the callback is the submitted value for the associated field; this may be a single value or an arrayref of value. The second argument passed to the callback is a hashref of name/value pairs for all input fields. This constraint doesn't honour the "not()" value. METHODS
callback Arguments: &sub_ref SEE ALSO
Is a sub-class of, and inherits methods from HTML::FormFu::Constraint HTML::FormFu 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 2012-01-23 HTML::FormFu::Constraint::CallbackOnce(3pm)
Man Page

3 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

HTML is causing problems

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)
Discussion started by: Perderabo
4 Replies

2. Shell Programming and Scripting

PCC-F-NOERRFILE, unable to open error message file

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)
Discussion started by: kavithakuttyk
1 Replies

3. Shell Programming and Scripting

Open HTML file

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)
Discussion started by: Coolman24
3 Replies