NAME

CGI::Mungo::Request - Form request class

SYNOPSIS

DESCRIPTION

All action subs are passed a CGI::Mungo object as the only parameter, from this you should be able to reach everything you need.

METHODS

new()

my $r = CGI::Mungo::Request->new();

Constructor, gets all the GET/POST information from the browser request.

getParameters()

validate()

my $rules = {
	'age' => {
		'rule' => '^\d+$',
		'friendly' => 'Your Age'
	}
};	#the form validation rules
my($result, $errors) = $r->validate($rules);

Validates all the current form fields against the provided hash reference.

The hash reference contains akey for every field you are concerned about, which is a reference to another hash containing two elements. The first is the actaul matching rule. The second is the friendly name for the field used in the error message, if a problem with the field is found.

The method returns two values, first being a 0 or a 1 indicating the success of the form. The second is a reference to a list of errors if any.

Notes

Author

MacGyveR <dumb@cpan.org>

Development questions, bug reports, and patches are welcome to the above address

Copyright

Copyright (c) 2009 MacGyveR. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 19:

You can't have =items (as at line 31) unless the first thing after the =over is an =item