Hyper::Validator - Validator base class for all validator classes


Back to Top


NAME

Hyper::Validator - Validator base class for all validator classes

Back to Top


VERSION

This document describes Hyper::Validator 0.02

Back to Top


SYNOPSIS

    package Hyper::Validator::Single;
    use Class::Std::Storable;
    use base qw(Hyper::Validator);
    1;

Back to Top


DESCRIPTION

Hyper::Validator provides basic features like templating for writing a validator class.

Back to Top


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.

Back to Top


DIAGNOSTICS

Back to Top


CONFIGURATION AND ENVIRONMENT

Back to Top


DEPENDENCIES

Back to Top


INCOMPATIBILITIES

Back to Top


BUGS AND LIMITATIONS

Back to Top


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/tags/0.05/lib/Hyper/Validator.pm $

Back to Top


AUTHOR

Andreas Specht <ACID@cpan.org>

Back to Top


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.

Back to Top

 Hyper::Validator - Validator base class for all validator classes