On Feb 13, 2008, at 8:22 PM, Carl Franks wrote:

On 13/02/2008, Andreas Marienborg <[EMAIL PROTECTED]> wrote:

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.


Heh, nice generalization :) I fixed up a few typos in the code so it now actually works :p



- andreas


_______________________________________________
HTML-FormFu mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to