[Html-widget] FormFu: Catalyst FormConfig + manual constraints

Tobias Kremer list at funkreich.de
Tue Apr 17 14:35:07 GMT 2007

I just started playing around with HTML::FormFu and I'm really liking
it up to now. However I haven't been able to use the FormConfig attribute
in my Catalyst controller to load the basics of a form _AND_ afterwards
add constraints manually. Here's my latest try:

sub signup : Local : FormConfig {
  my( $self, $c ) = @_;
  $c->stash->{ 'form' }->constraint( {
    type     => 'Callback',
    name     => 'captcha',
    callback => sub { return 0; # just to see if it's working }
  } ); # as documented in HTML::FormFu::Constraint::Callback's POD

  my $form = $c->stash->{ 'form' };
  if( $form->submitted_and_valid ) { .. }

The constraint is not added to the form loaded via Config::Any. Am
I doing something wrong? Or is it impossible to add constraints after
using FormConfig to prepare the form?



_______________________________________________ _  _
(web)         http://www.funkreich.de
(last.fm)     http://www.last.fm/user/soulchild77

More information about the Html-widget mailing list