[html-formfu] Question about DBIC-integration

Carl Franks fireartist at gmail.com
Wed Feb 13 19:22:14 GMT 2008


On 13/02/2008, Andreas Marienborg <omega at palle.net> wrote:
>
> I get "can't locate pre_process via package
> "HTML::FormFu::Plugin::Catalyst::StashUserID" at /Users/andreas/
> Projects/opensource/html-formfu-trunk/HTML-FormFu/lib/HTML/FormFu.pm
> line 848."

okay, fixed that. It was an error in HTML/FormFu.pm

> I want to expand process to support specified id_method and object-
> traversal based on it.
>
> what I propose is
>
> plugins:
>         - type: 'Catalyst::StashUserID'
>           id_method: obj.id
>
>
> results in process in $c->user->obj->id being called.

I've made it a bit more general, and renamed it to
Catalyst::StashContextMethods.
You can now achieve the same using:

    ---
    plugins:
      - type: 'Catalyst::StashContextMethods'
        stash_key: user_id
        methods: [user, obj, id]

This essentially does:
    $form->stash->{user_id} = $form->stash->{context}->user->obj->id;

I'll add a www-mechanize-catalyst test, next.

> does that sound reasonable? what about the two missing methods. I'll
> see about adding a boilerplate Makefile.PL as well, as I need that to
> build it for production :)

okay, I've added a Makefile.PL and also a HTML/FormFu/Catalyst.pm to
provide a version no.

Carl



More information about the HTML-FormFu mailing list