| Form-Factory documentation | Contained in the Form-Factory distribution. |
Form::Factory::Control::Role::Labeled - labeled controls
version 0.020
Implemented by any control with a label.
The label. By default it is created from the control's name.
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::Role::Labeled; BEGIN { $Form::Factory::Control::Role::Labeled::VERSION = '0.020'; } use Moose::Role;
has label => ( is => 'ro', isa => 'Str', required => 1, builder => '_build_label', ); sub _build_label { my $self = shift; my $label = $self->name; $label =~ s/_/ /g; $label =~ s/\b(\w)/\U$1\E/g; return $label; }
1;