[html-formfu] Unable to create a Callback constraint via
populate()
Michele Beltrame
mb at cattlegrid.info
Thu May 1 10:21:27 BST 2008
Hi again Carl!
As an alternative option for having access to some context from the
Callback constraints/inflators/whatever, I was thinking that maybe the
form object could be automatically passed as the third parameter to the
callback functions, so that they would then have access to the stashed
context. For instance in Catalyst we would have:
sub mycallback {
my ( $value, $fields, $form ) = @_;
my $c = $form->stash->{context};
# ....
}
This would be handy for folks who populate forms using YAML files where
it would be a bit uneasy to provide closures as callbacks.
Of course, in my opinion closures should really be left there as the
maybe primary option, as they're really one of the things which make
Perl (and other languages which provide them) really powerful.
Just my 2 € cents. ;)
Talk to you soon,
Michele.
--
Michele Beltrame
http://www.cattlegrid.info/
ICQ 76660101 - MSN mb at italpro.net
More information about the HTML-FormFu
mailing list