On 26/03/2008, Andreas Marienborg <[EMAIL PROTECTED]> wrote:
>
> On Mar 26, 2008, at 1:46 PM, Carl Franks wrote:
>
> > On 26/03/2008, Andreas Marienborg <[EMAIL PROTECTED]> wrote:
> >> Currently, I use the Catalyst-plugin to stash the language the app is
> >> deployed as in the formfu-stash. I would like to use this as the
> >> default-value for the country dropdown, and as such came the idea
> >> of a
> >> generic way to use stash-values. Not sure how to do it cleanly
> >> though,
> >> so its more a random thought at the moment
> >>
> >>
> >> any ideas? Can anyone else think of useful uses for such a feature?
> >
> > Can't really think of a generic way - but we could give all fields a
> > default_from_stash($key) method?
> > kinda like Model-DBIC's condition_from_stash()
>
>
> Yeah, I was thinking about that, but then one might want
> attribute_from_stash, value_from_stash etc :p
>
> I guess default_from_stash would solve my imidiate problem, so I guess
> I might just implement that, if thats ok?
hmm, I suppose you could make it more like condition_from_stash(), and
have it accept a hashref:
method_from_stash({ default => $key })
although that wouldn't work for general attributes() that don't have a
dedicated method.
Carl
_______________________________________________
HTML-FormFu mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu