Nate Wiger | 17 Aug 02:14

Catalyst FormBuilder plugin on CPAN

All-

I just now uploaded Catalyst::Plugin::FormBuilder to CPAN, which adds 
support for FormBuilder in Catalyst. It's also available here:

http://www.formbuilder.org/download/Catalyst-Plugin-FormBuilder-1.02.tar.gz

Usage is similar to XMLRPC: for those controller methods that contain 
forms, simply associate a ":Form" attribute with them:

     package MyApp::Controller::Books;

     sub edit : Form {
         # this automatically loads root/forms/books/edit.fb
         # and creates a $c->form object for you
         $c->form->method('post');
         $c->form->messages('messages.fr');  # French errors
     }

The page rendering is handled for you by Catalyst using its Template 
Toolkit hooks. To get a standard form, just call form.render in your 
template:

     <!-- root/src/books/edit.tt -->
     [% form.render %]

Or, if you want finer control over the placement of your fields, you can 
directly render your form using FormBuilder methods:

     <head>[% form.jshead %]</head>
(Continue reading)

Matt S Trout | 17 Aug 02:33
Picon

Re: Catalyst FormBuilder plugin on CPAN

Nate Wiger wrote:
> All-
> 
> I just now uploaded Catalyst::Plugin::FormBuilder to CPAN, which adds 
> support for FormBuilder in Catalyst. It's also available here:
> 
> http://www.formbuilder.org/download/Catalyst-Plugin-FormBuilder-1.02.tar.gz
> 
> Usage is similar to XMLRPC: for those controller methods that contain 
> forms, simply associate a ":Form" attribute with them:
> 
>      package MyApp::Controller::Books;
> 
>      sub edit : Form {
>          # this automatically loads root/forms/books/edit.fb
>          # and creates a $c->form object for you
>          $c->form->method('post');
>          $c->form->messages('messages.fr');  # French errors
>      }
> 
> The page rendering is handled for you by Catalyst using its Template 
> Toolkit hooks. To get a standard form, just call form.render in your 
> template:
> 
>      <!-- root/src/books/edit.tt -->
>      [% form.render %]
> 
> Or, if you want finer control over the placement of your fields, you can 
> directly render your form using FormBuilder methods:
> 
(Continue reading)


Gmane