[html-formfu] self.form.has_errors in TT templates

Carl Franks fireartist at gmail.com
Tue Jan 15 09:40:31 GMT 2008


On 15/01/2008, Steffen Schwigon <schwigon at webit.de> wrote:
> Hi!
>
> I upgraded HTML::FormFu (0.02003) and
> Catalyst::Controller::HTML::FormFu (0.02000).
>
> I use it with TT templates, regenerated the root/formfu files and
> everything generally works.
>
> However, I'm somehow unable to find the replacement of something I did
> before:
>
>   [% IF self.form.has_errors %]
>   ...
>
> The has_errors() method works inside the Catalyst controller, but not
> in the TT template (I need it in file "form").
>
> As a workaround I'm also not sure how to transport the result of
> has_errors() from the Catalyst controller into the template in another
> way.

It's fixed now - it's not strictly necessary because "self" in the
form template is the form, so "self.form" is a bit redundant - but
anyway, I've fixed it in svn so it'll work.

I'm hoping to get another cpan release out in the next week or so.

btw, just checking that you know that HTML-FormFu doesn't use the
template files by default any more - you need to set
$form->render_method('tt') to use the template files.

Cheers,
Carl



More information about the HTML-FormFu mailing list