Subject: | wrapper field with before_element and do_label option incorrect |
#!/bin/env perl
package PeSystem::Form::Announcement;
use HTML::FormHandler::Moose;
extends 'HTML::FormHandler';
use namespace::autoclean;
has '+widget_wrapper' => ( default => 'Bootstrap');
has_field 'addresses' => (
type => 'Repeatable',
do_wrapper => 1,
do_label => 1, label => 'Adress',
num_when_empty => 3,
tags => { before_element => '<table>' , after_element => '</table>'
},
);
has_field 'addresses.contains' => (
#widget_wrapper => 'Table' ,
type => 'Text',
#do_label => 1
);
sub build_form_element_class { ['form-horizontal'] }
__PACKAGE__->meta->make_immutable;
no HTML::FormHandler::Moose;
package main;
my $form = PeSystem::Form::Announcement->new;
print $form->field('addresses')->render;
output:
<div class="control-group">
<label class="control-label" for="addresses">Adress</label><table>
<div class="controls">
<div class="control-group">
<label class="control-label" for="addresses.0">0</label>
<div class="controls">
<input type="text" name="addresses.0" id="addresses.0" value="" /></div>
</div>
<div class="control-group">
<label class="control-label" for="addresses.1">1</label>
<div class="controls">
<input type="text" name="addresses.1" id="addresses.1" value="" /></div>
</div></table></div>
</div>
========= two "table" tag are not match ============