[Catalyst] using $c in my formvalidation
Wijnand Wiersma
wijnand at nedbsd.nl
Fri Feb 3 23:07:42 CET 2006
I am using Data::FormValidator in one of my controllers. I have the full
configuration in the BEGIN part of the controller file.
I want to check if the user has a valid country code so I added a
constraint which calls back to a function I have. That function tries to
use the Countrycodes model I have in my catalyst app. However, that
validation function expects ($self, $c, $countrycode) but I cannot give
that as param for the validation functions since $c is not yet defined
at that moment since the configuration of Data::FormValidator is in
BEGIN. $self is not important, I can skip that (and I will).
Does anyone here know a nice and clean workaround for this?
If needed, I will produce some example code.
Wijnand
More information about the Catalyst
mailing list