| 1 | package HTML::Shakan::Renderer::HTML; | ||||||||||||||||||||||||||||
| 2 | 22 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 22 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 22 | ▶ | use Mouse; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 22 | ▶ | use HTML::Escape (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 22 | has 'id_tmpl' => ( | |||||||||||||||||||||||||||
| 8 | is => 'ro', | ||||||||||||||||||||||||||||
| 9 | isa => 'Str', | ||||||||||||||||||||||||||||
| 10 | default => 'id_%s', | ||||||||||||||||||||||||||||
| 11 | ); | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 0 | ▶ | sub render { | ||||||||||||||||||||||||||
|
Subroutine
render: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 14 | 0 | my ($self, $form) = @_; | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 0 | my @res; | |||||||||||||||||||||||||||
| 17 | 0 | for my $field ($form->fields) { | |||||||||||||||||||||||||||
| 18 | 0 | ▶ | unless ($field->id) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 19 | 0 | $field->id(sprintf($self->id_tmpl(), $field->{name})); | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | 0 | ▶ | if ($field->label) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | my $label_css = ($field->has_label_class() && $field->label_class ne '') | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$field->has_label_class and $field->label_class ne ""
MC/DC0%0/2
$field->has_label_class and $field->label_class ne ""
$field->has_label_class
$field->label_class ne ""
Truth table0%0/3
A and B
A= $field->has_label_classB= $field->label_class ne ""
| |||||||||||||||||||||||||||||
| 23 | ? sprintf(q{ class="%s"}, $field->label_class) | ||||||||||||||||||||||||||||
| 24 | : ''; | ||||||||||||||||||||||||||||
| 25 | push @res, sprintf( q{<label%s for="%s">%s</label>}, | ||||||||||||||||||||||||||||
| 26 | 0 | $label_css, $field->{id}, HTML::Escape::escape_html( $field->{label} ) ); | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | 0 | push @res, $form->widgets->render( $form, $field ); | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | 0 | join '', @res; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 22 | ▶ | no Mouse; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 34 | 22 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 35 | __END__ | ||||||||||||||||||||||||||||