| Form-Factory documentation | Contained in the Form-Factory distribution. |
Form::Factory::Control::Text - A single line text field
version 0.020
has_control your_name => (
control => 'text',
options => {
label => 'Your Real Name',
default_value => 'Thomas Anderson',
},
);
A regular text box.
This control implements Form::Factory::Control, Form::Factory::Control::Role::Labeled, and Form::Factory::Control::Role::ScalarValue.
We have a current value if it is defined and has a non-zero string length.
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
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.
| Form-Factory documentation | Contained in the Form-Factory distribution. |
package Form::Factory::Control::Text; BEGIN { $Form::Factory::Control::Text::VERSION = '0.020'; } use Moose; with qw( Form::Factory::Control Form::Factory::Control::Role::Labeled Form::Factory::Control::Role::ScalarValue );
has '+value' => ( isa => 'Str', ); has '+default_value' => ( isa => 'Str', default => '', );
around has_current_value => sub { my $next = shift; my $self = shift; return ($self->has_value || $self->has_default_value) && length($self->current_value) > 0; };
1;