| 1 | package HTML::FormHandler::Widget::Wrapper::Fieldset; | ||
| 2 | # ABSTRACT: fieldset field wrapper | ||
| 3 | 1 | $HTML::FormHandler::Widget::Wrapper::Fieldset::VERSION = '0.410001'; | |
| 4 | 1 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use HTML::Entities qw( encode_entities ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 1 | with 'HTML::FormHandler::Widget::Wrapper::Base'; | |
| 9 | 1 | ▶ | use HTML::FormHandler::Render::Util ('process_attrs'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | |||
| 12 | sub wrap_field { | ||
| 13 | 3 | ▶ | my ( $self, $result, $rendered_widget ) = @_; |
|
Subroutine
wrap_field: called CC=2 SCAR=7.0
Pod
undocumented
| |||
| 14 | |||
| 15 | 3 | my $wattrs = process_attrs($self->wrapper_attributes); | |
| 16 | 3 | my $output = qq{\n<fieldset$wattrs>}; | |
| 17 | 3 | $output .= qq{\n<legend>} . $self->loc_label . '</legend>'; | |
| 18 | |||
| 19 | 3 | $output .= "\n$rendered_widget"; | |
| 20 | |||
| 21 | $output .= qq{\n<span class="error_message">$_</span>} | ||
| 22 | 3 | for map { encode_entities($_) } $result->all_errors; | |
| 23 | 3 | $output .= "\n</fieldset>"; | |
| 24 | |||
| 25 | 3 | return $output; | |
| 26 | } | ||
| 27 | |||
| 28 | 1 | 1; | |
| 29 | |||
| 30 | __END__ | ||
| 31 | |||
| 32 | =pod | ||
| 33 | |||
| 34 | =encoding UTF-8 | ||
| 35 | |||
| 36 | =head1 NAME | ||
| 37 | |||
| 38 | HTML::FormHandler::Widget::Wrapper::Fieldset - fieldset field wrapper | ||
| 39 | |||
| 40 | =head1 VERSION | ||
| 41 | |||
| 42 | version 0.410001 | ||
| 43 | |||
| 44 | =head1 SYNOPSIS | ||
| 45 | |||
| 46 | Wraps a single field in a fieldset. | ||
| 47 | |||
| 48 | =head1 NAME | ||
| 49 | |||
| 50 | HTML::FormHandler::Widget::Wrapper::Fieldset - fieldset field wrapper | ||
| 51 | |||
| 52 | =head1 AUTHOR | ||
| 53 | |||
| 54 | FormHandler Contributors - see HTML::FormHandler | ||
| 55 | |||
| 56 | =head1 COPYRIGHT AND LICENSE | ||
| 57 | |||
| 58 | This software is copyright (c) 2017 by Gerda Shank. | ||
| 59 | |||
| 60 | This is free software; you can redistribute it and/or modify it under | ||
| 61 | the same terms as the Perl 5 programming language system itself. | ||
| 62 | |||
| 63 | =cut | ||