logo       
Google Custom Search
    AddThis Social Bookmark Button

[FormBuilder] name template variable for Catalyst::Plugin::FormBuilder: msg#00018

Subject: [FormBuilder] name template variable for Catalyst::Plugin::FormBuilder
There's no way in the Catalyst plugin to get the equivalent of 
$form->{template}->{variable}.

So if you do cascading actions, for example a search form always 
in the top of the page but then a CRUD form in the page body,
there is no way to differentiate them in TT2.  (One would 
overwrite the other?)

How about this - a config param called 'template_name' for the 
form's config file.

--- /tmp/FormBuilder.pm 2006-10-14 13:12:13.000000000 -0700
+++ /usr/local/share/perl/5.8.8/Catalyst/Plugin/FormBuilder.pm  2006-10-14 
13:15:30.000000000 -0700
@@ -133,7 +133,9 @@
     $attr{debug} = $c->debug ? 2 : 0;
     $c->log->debug("Form ($name): Calling FormBuilder->new to create form")
         if $c->debug;
-    $c->stash->{form} = $c->{form} = CGI::FormBuilder->new(\%attr);
+
+    my $form_name = $attr{template_name} || 'form';
+    $c->stash->{$form_name} = $c->{$form_name} = CGI::FormBuilder->new(\%attr);
     return $c;
 }

_______________________________________________
FBusers mailing list
FBusers@xxxxxxxxxxxxxxx
http://www.formbuilder.org/mailman/listinfo/fbusers




Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>