[Catalyst] On HTML::FormFu rendering

Andreas Marienborg omega at palle.net
Wed Mar 5 15:23:39 GMT 2008


On Mar 5, 2008, at 4:03 PM, Alex Povolotsky wrote:

> Hello!
>
> I'm trying to use Catalyst::Controller::HTML::FormFu
>
> Code is quite simple for this time
> === from controller ===
> sub add : Local FormConfig {
>   my ($self, $c) = @_;
>   my $form : Stashed;
> }
> === cut ===
>
> === TT template ===
> [% META title = 'Add user' %]
> [% Form.render %]
> === cut ===
>
> === YML template ===
> ---
> elements:
> - type: Text
>   name: login
>   label: 'Login:'
> - type: Password
>   name: pass1
>   label: 'Password:'
> - type: Password
>   name: pass2
>   label: 'Repeat password:'
> - type: Submit
>
> === cut ===
>
> However, form does not get rendered. form.render works, but should  
> Form.render be better?
>
> And can I produce much nicer forms as FormBuilder do by default?


Catalyst::Controller::HTML::FormFu puts the form-object in the stash  
variable 'form' by default. Form is not something  
Catalyst::Controller::HTML::FormFu puts in your stash, so unless you  
do that yourself, your problem with Form.render is probably that Form  
is undefined. TT silently ignores undefined.

http://code.google.com/p/html-formfu/source/browse/trunk/HTML-FormFu/examples/

Here are two examples, with CSS, that might help you get started.  
HTML::FormFu attempts to output html that can be flexibly styled using  
CSS.


- andreas




More information about the Catalyst mailing list