[Catalyst] On HTML::FormFu rendering
Carl Franks
fireartist at gmail.com
Wed Mar 5 15:16:03 GMT 2008
On 05/03/2008, Alex Povolotsky <tarkhil at over.ru> 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?
HTML::FormFu is not FormBuilder
If you want "Form" instead of "form", you need to set "form_stash" in
your Controller::HTML::FormFu config
see - http://search.cpan.org/~cfranks/Catalyst-Controller-HTML-FormFu-0.02000/lib/Catalyst/Controller/HTML/FormFu.pm#form_stash
I'd guess that if you do that, you'll need to change:
my $form : Stashed;
to
my $Form : Stashed;
(I'm not entirely sure, having never used that plugin)
> And can I produce much nicer forms as FormBuilder do by default?
Can you be more specific?
Have you checked out the css in examples/vertically-aligned-css/ ?
Carl
More information about the Catalyst
mailing list