[Catalyst] FormBuilder not working

Hani Anani hanianani at gmail.com
Sat Sep 20 07:58:47 BST 2008


Hello Abhishek,

I suspect the problem is with the naming of your files and dir structure.

If search2 method is in the Project module you will need to do the
following:

1. create a project sub dir in your root/forms dir
2. move your form definition file to the root/forms/project/search2.fb
3. Your template should be defined in root/project/search.tt2 you specify
this in your code
     $c->stash->{template} =3D 'project/search2.tt2';
    This is unecessary since Catalyst does this for you.

I do have to say I am a little confused, cause you refer to
root/src/search2.tt2 at the start of the email, in that case you might just
need to rename your form file to search2.fb to match you method's name.

Hope this helps you figure out what went wrong,
-Hani

On Fri, Sep 19, 2008 at 11:31 PM, abhishek jain
<abhishek.netjain at gmail.com>wrote:

> Hello Friends,I am new to Catalyst and need to implement FormBuilder.
> What i am doing is:
> a template called root/src/search2.tt2 with the following content;
>
> [% META title =3D "Edit a person" %]
> [% FormBuilder.render %]
>
> a form script on root/forms/search.db
>
> in controller i have the following function
>
> sub search2 : Local Form {
>         my ( $self, $c ) =3D @_;
>         $c->stash->{template} =3D 'project/search2.tt2';
> }
>
> Do I need to do anything extra, i can get a page but without the form.
> Pl.help.
> --
> Thanks and kind Regards,
> Abhishek jain
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080919/c1423=
9ea/attachment.htm


More information about the Catalyst mailing list