The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Chloro::Group - A field in a form

VERSION

version 0.07

SYNOPSIS

See Chloro.

DESCRIPTION

This class represents a group in a form.

METHODS

This class has the following methods:

Chloro::Group->new()

You'll probably make groups by using the group() subroutine exported by Chloro, but you can make one using this constructor.

The constructor accepts the following parameters:

  • name

    The name of the group. This is required.

  • human_name

    A more friendly version of the name. This defaults to the same value as name.

  • fields

    An array reference of Chloro::Field objects for this group. This is required.

  • repetition_key

    The name of the key field for repetitions.

  • is_empty_checker

    This is an optional method on the field's form that will be used to extract this field's value.

$group->name()

The name as passed to the constructor.

$group->human_name()

A more friendly name, which defaults to the same value as $group->name().

$group->fields()

Returns a list of Chloro::Field objects for this group

$group->get_field($name)

Given a name, returns the field of that name in the group, if one exists.

$group->repetition_key()

The name of the repetition key field for this group.

$group->is_empty_checker()

Returns the method used to determine whether the group is empty. This defaults to _group_is_empty, a method provided by Chloro::Role::Form.

$group->dump()

Returns a data structure representing the group definition. This exists primarily for testing.

ROLES

This class consumes the Chloro::Role::FormComponent role.

SUPPORT

Bugs may be submitted at http://rt.cpan.org/Public/Dist/Display.html?Name=Chloro or via email to bug-chloro@rt.cpan.org.

I am also usually active on IRC as 'autarch' on irc://irc.perl.org.

SOURCE

The source code repository for Chloro can be found at https://github.com/autarch/Chloro.

AUTHOR

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2017 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)

The full text of the license can be found in the LICENSE file included with this distribution.