[html-formfu] Modifying generated html for some form elements

Carl Franks fireartist at gmail.com
Wed Mar 10 21:09:57 GMT 2010


I think my preferred method would be to create a custom subclasss of
Textarea which provides its own string_field() looking something like
this:

sub _string_field {
    my ( $self, $render ) = @_;

    my $html = q{<div class="textarea_container">};
    $html .= $self->next::method($render);
    $html .= q{</div>};

    return $html;
}

Then just load it in your config like so:
element:
    - type: '+MyApp::Element::TinyCME'

Alternatively, you could switch that one element to use the TT
template files and write a custom template.

Cheers,
Carl



More information about the HTML-FormFu mailing list