fix tabs and tabsets in FormBuilder
This commit is contained in:
parent
6dea8e8d05
commit
0b5614ad1c
2 changed files with 42 additions and 16 deletions
|
|
@ -139,4 +139,30 @@ sub toHtml {
|
|||
return $html;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 toTemplateVars ( )
|
||||
|
||||
Return a hashref of template vars to re-create this tabset
|
||||
|
||||
=cut
|
||||
|
||||
sub toTemplateVars {
|
||||
my ( $self ) = @_;
|
||||
my $var = {};
|
||||
|
||||
$var->{ tabs } = [];
|
||||
for my $tab ( $self->tabs ) {
|
||||
my $name = $tab->name;
|
||||
my $props = $tab->toTemplateVars;
|
||||
$var->{ "tabs_${name}" } = $tab->toHtml;
|
||||
push @{$var->{tabs}}, $props;
|
||||
for my $key ( %$props ) {
|
||||
$var->{ "tabs_${name}_${key}" } = $props->{$key};
|
||||
}
|
||||
}
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue