Hyper::Control::Base - base class for all base control classes
This document describes Hyper::Control::Base 0.01
package Hyper::Control::Base::BSampleControl; use Class::Std::Storable; use base qw(Hyper::Control::Base); 1;
Hyper::Control::Base provides functions like managing single validators, validation, getting value without handling CGI things etc. We provide basicly everything whats needed for base controls.
Control which provides validation with methods for Single Validators.
$object->set_value('Damian Conway');
or for multiple values
$object->set_value(['Damian Conway', 'Lary Wall']);
Set value for this object. Also useful for preselection.
$object->clear();
Shortcut to object attribute value to undef.
$object->add_single_validator( Hyper::Validator::Single::Required->new() );
Registers validators in our Validator Control.
$object->join_group({ group => $self->get_object('vCompareGroupValidator'), act_as => 'first', });
Join a validator group with a defined role (act_as).
$object->is_valid();
This method communicates with the attached Validator Control. Checks if all registered validators think that the current value of this object is valid. If all validators are valid group validators are checked. Validators whose validation fails will add their error message to the validator field. Method is_valid returns a boolean value.
my $value = $object->get_value();
my @values = $object->get_value();
Returns an an array of current values (post/get params) in list config and single value in scalar context. If we have multiple values we also return only one value (the first one) in scalar context.
Calls template from get_template and sets the param this to $self. Returns $template->output();
Calls populate_show_state to update the control's show_state.
Informs the the application that element was show via calling the applications method set_show_state. This is used to update the controls value automatically from CGI on an object thaw.
Don't use this method for your code. It's called automaticaly after object was thawn. The method calls _set_from_cgi to fill our object with cgi params.
$self->_set_from_cgi();
Set our value from cgi if current post/get request has data for our object (parameter name = object name). Setting single and multiple values is supported.
version
Class::Std::Storable
Hyper::Control::Template
Hyper::Control
Hyper::Name
List::MoreUtils
Hyper::Singleton::CGI
Hyper::Singleton::Debug
$Author: ac0v $
$Id: Base.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/branches/0.04/lib/Hyper/Control/Base.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.