Hyper::Validator - Validator base class for all validator classes
This document describes Hyper::Validator 0.02
package Hyper::Validator::Single; use Class::Std::Storable; use base qw(Hyper::Validator); 1;
Hyper::Validator provides basic features like templating for writing a validator class.
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)
$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.
# 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.
$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.
version
Class::Std::Storable
Hyper::Control::Template
$Author: ac0v $
$Id: Validator.pm 474 2008-05-29 13:25:22Z ac0v $
$Revision: 474 $
$Date: 2008-05-29 15:25:22 +0200 (Do, 29 Mai 2008) $
$HeadURL: http://svn.hyper-framework.org/Hyper/Hyper/tags/0.05/lib/Hyper/Validator.pm $
Andreas Specht <ACID@cpan.org>
<ACID@cpan.org>
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.
To install Hyper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Hyper
CPAN shell
perl -MCPAN -e shell install Hyper
For more information on module installation, please visit the detailed CPAN module installation guide.