| 1 | package Form::Factory::Control::Role::Labeled; | ||
| 2 | 1 | $Form::Factory::Control::Role::Labeled::VERSION = '0.022'; | |
| 3 | 1 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | # ABSTRACT: labeled controls | ||
| 6 | |||
| 7 | |||
| 8 | 1 | has label => ( | |
| 9 | is => 'ro', | ||
| 10 | isa => 'Str', | ||
| 11 | required => 1, | ||
| 12 | builder => '_build_label', | ||
| 13 | lazy => 1, | ||
| 14 | ); | ||
| 15 | |||
| 16 | 31 | ▶ | sub _build_label { |
|
Subroutine
_build_label: called CC=1 SCAR=0.0
| |||
| 17 | 31 | my $self = shift; | |
| 18 | 31 | my $label = $self->name; | |
| 19 | 31 | $label =~ s/_/ /g; | |
| 20 | 31 | $label =~ s/\b(\w)/\U$1\E/g; | |
| 21 | 31 | return $label; | |
| 22 | } | ||
| 23 | |||
| 24 | 1 | 1; | |
| 25 | |||
| 26 | __END__ | ||