NAME
Hyper::Validator - Validator base class for all validator classes
VERSION
This document describes Hyper::Validator 0.02
SYNOPSIS
package Hyper::Validator::Single;
use Class::Std::Storable;
use base qw(Hyper::Validator);
1;
DESCRIPTION
Hyper::Validator provides basic features like templating for writing a validator class.
SUBROUTINES/METHODS
new
my $object = Hyper::Validator->new();
or with template filename and owner
my $object = Hyper::Validator->new({
owner => $input_object,
});
Contructor with additional owner parameter, which sets the owner of this validator (eg. a specific input or text field object)
get_html
$object->get_html();
Add the the 'is_valid' param to the template and return the return value of the output method of template.
The 'is_valid' param indicates if any value was invalid.
get_next_html
# validate an object with one valid and one invalid value
# show valid message
$object->get_next_html();
# show invalid message
$object->get_next_html();
Works like get_html expect that the 'is_valid' param indicates if the current value (we iterate over the values validation state) is valid. The values are handled iterative.
is_valid
$object->is_valid();
Calls the object method VALIDATE, stores the return value in the object attribute is_valid and a list of valid/invalid states in the private attribute _valid_state_of. The return value indicates if all values are valid.
DIAGNOSTICS
CONFIGURATION AND ENVIRONMENT
DEPENDENCIES
version
Class::Std::Storable
Hyper::Control::Template
INCOMPATIBILITIES
BUGS AND LIMITATIONS
RCS INFORMATIONS
- Last changed by
-
$Author: ac0v $
- Id
-
$Id: Validator.pm 474 2008-05-29 13:25:22Z ac0v $
- Revision
-
$Revision: 474 $
- Date
-
$Date: 2008-05-29 15:25:22 +0200 (Do, 29 Mai 2008) $
- HeadURL
-
$HeadURL: http://svn.hyper-framework.org/Hyper/Hyper/branches/0.04/lib/Hyper/Validator.pm $
AUTHOR
Andreas Specht <ACID@cpan.org>
LICENSE AND COPYRIGHT
Copyright (c) 2007, Andreas Specht <ACID@cpan.org>
. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.