Andrew Sterling Hanenkamp > Form-Factory > Form::Factory::Control::Choice

Download:
Form-Factory-0.020.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.020   Source  

NAME ^

Form::Factory::Control::Choice - Helper class for tracking choices

VERSION ^

version 0.020

SYNOPSIS ^

  my $foo = Form::Factory::Control::Choice->new('foo');
  my $bar = Form::Factory::Control::Choice->new('bar' => 'Bar');
  my $baz = Form::Factory::Control::Choice->new(
      label => 'Baz',
      value => 'baz',
  );
  my $qux = Form::Factory::Control::Choice->new({
      label => 'Qux',
      value => 'qux',
  });

DESCRIPTION ^

These objects represent a single choice for a list or popup box. Each choice has a label and a value. The constructor is flexible to allow the following uses:

  my $choice = Form::Factory::Control::Choice->new($value) # $label = $value
  my $choice = Form::Factory::Control::Choice->new($value => $label);
  my $choice = Form::Factory::Control::Choice->new(
      label => $label,
      value => $value,
  );
  my $choice = Form::Factory::Control::Choice->new({
      label => $label,
      value => $value,
  });

If $value and $label are the same, all of those calls are identical.

ATTRIBUTES ^

label

The label to give the choice.

value

The value of the choice.

AUTHOR ^

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright 2009 Qubling Software LLC.

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

syntax highlighting: