[html-formfu] Question about DBIC-integration
Andreas Marienborg
omega at palle.net
Thu Feb 14 08:14:11 GMT 2008
On Feb 13, 2008, at 8:22 PM, Carl Franks wrote:
> On 13/02/2008, Andreas Marienborg <omega at palle.net> 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
More information about the HTML-FormFu
mailing list