[Catalyst] Data::FormValidator
Hartmaier Alexander
Alexander.Hartmaier at t-systems.at
Thu Nov 24 13:02:19 CET 2005
Hi!
In my controllers i do
# get formvalidator error messages
$c->stash->{errors} = $c->form->msgs || ();
and in my TT templates:
<table>
<colgroup>
<col style="width: 8em" />
<col class="red" />
</colgroup>
[% FOREACH field IN errors.keys %]
<tr>
[% IF field_names.$field %]
<td>[% field_names.$field %]</td>
[% ELSIF field_names_entries.$field %]
<td>[% field_names_entries.$field %]</td>
[% ELSE %]
<td>[% field %]</td>
[% END %]
<td>[% errors.$field %]</td>
</tr>
[% END %]
</table>
-Alex
-----Original Message-----
From: catalyst-bounces at lists.rawmode.org
[mailto:catalyst-bounces at lists.rawmode.org] On Behalf Of Caroline Johnston
Sent: Thursday, November 24, 2005 12:19 PM
To: The elegant MVC web framework
Subject: [Catalyst] Data::FormValidator
Hello,
I'm playing with the Data::FormValidator plugin. Anyone know how to
get rid of the default message styling?
Just setting a CSS definition for dfv_errors doesn't really work because I
don't always want the same format.
I could just msgs=>{format=>'<span class='dfv_errors>%s</span>'} in every
profile, but I'd rather just set it once for the whole app if possible. Am
I missing an obvious way to do this?
Cheers,
Cxx
_______________________________________________
Catalyst mailing list
Catalyst at lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5544 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20051124/a8b6f59a/smime.bin
More information about the Catalyst
mailing list