Form::Factory::Control::Button - The button control


Form-Factory documentation Contained in the Form-Factory distribution.

Index


Code Index:

NAME

Top

Form::Factory::Control::Button - The button control

VERSION

Top

version 0.020

SYNOPSIS

Top

  has_control a_button => (
      control => 'button',
      options => {
          label => 'My Button',
      },
  );

DESCRIPTION

Top

A control representing a submit button. This control implements Form::Factory::Control, Form::Factory::Control::Role::BooleanValue, Form::Factory::Control::Role::Labeled, Form::Factory::Control::Role::ScalarValue.

ATTRIBUTES

Top

true_value

See Form::Factory::Control::Role::BooleanValue. By default, this value is set to the label. If you change this to something else, the button might not work correctly anymore.

METHODS

Top

default_isa

Boolean values default to Bool.

AUTHOR

Top

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE

Top


Form-Factory documentation Contained in the Form-Factory distribution.
package Form::Factory::Control::Button;
BEGIN {
  $Form::Factory::Control::Button::VERSION = '0.020';
}
use Moose;

with qw(
    Form::Factory::Control
    Form::Factory::Control::Role::BooleanValue
    Form::Factory::Control::Role::Labeled
);

has '+value' => (
    isa       => 'Str',
);

has '+default_value' => (
    isa       => 'Str',
    lazy      => 1,
    default   => sub { shift->label },
);

has '+true_value' => (
    lazy      => 1,
    default   => sub { shift->label },
);

use constant default_isa => 'Str';

1;