NAME

HTML::Form::Declare - Object description of the form elements

VERSION

Version 0.03_l

SYNOPSIS

use HTML::Form::Declare;

## Login generator
sub generate_login {...};

## Validators
sub check_login {...};
sub check_password_with_confirm {...};
sub check_pass {};


my $conf = {
	lists_of_containers => ['groups'],
	parent_fields => ['required'],
};
my $fields = {
	config       => $config,
	method       => 'POST',
	id			 => 'form_registration',
	name         => 'form_registration',
	prefix       => 'my_form_',
	required     => 1,
	filter       => 2**1 | 2**3,
	groups       => [
		{
			name      => { 2**1 => 'Vhod', 2**3 => 'Registratsionnye dannye' },
			order     => 10,
			prefix    => { 2**1 => 'login:', 2**3 => 'reg:' },
			fields    => [
				{
					label        => 'Login',
					formfield    => 'login',
					object_name  => 'login',
					validate     => { 2**3 => \&check_login },
					value        => { 2**3 => generate_login() },
					type         => { 2**3 => 'login', 2**1 => 'text' },
					comment      => { 2**3 => 'Naprimer: ' . generate_login() },
					order        => 10,
				},
				{
					validate     => \&check_password_with_confirm,
					type         => 'password_with_confirm',
					formfield    => 'passowrd',
					object_name  => 'passwd',
					order        => 20,
					fields    => [
						{
							label        => 'Parol'',
							formfield    => 'passowrd_main',
							validate     => \&check_pass,
							type         => 'password',
							order        => 10,
						},
						{
							label        => 'Povtorite parol'',
							formfield    => 'password_confirm',
							type         => 'password',
							filter       => 2**3,
							order        => 20,
						},
					],
				},
			],
		},
	],
};


my $filter = 2**3;
my $form = HTML::Form::Declare->generate_form_fields( $fields, $filter, { global_prefix=>'new:' }, $replace );

## Return structure to TT

DESCRIPTION

	Create a structure of form. Call L<generate_form_fields> method and obtain the structure of the form by HTML::Form::Declare::Object.
    $filter - bit filter
    [, bit filter[, overdetermined parameters of congig[, options for replacing]]]

FUNCTIONS

generate_form_fields

AUTHOR

shv, <shv@cpan.org>

BUGS

Please report any bugs or feature requests to bug-html-form-declare at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=HTML-Form-Declare. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc HTML::Form::Declare

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2009 shv, all rights reserved.

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