Good evening,

On 17/9/07 at 12:55 PM +0100, Ton Voon <[EMAIL PROTECTED]> wrote:

However, one key bit of information I'd like to save is the user at the web app level. But this is not passed to the model. What would be a good way of having that information passed to the model (I was thinking of setting an environment variable at the start of a request and then removing it at the end)? Or is it best to have audit logs at the controller?

What have others done in similar cases?

You're looking for ACCEPT_CONTEXT. Took me a while to get the right setup so that it did what I needed but works great now. I couldn't find *one* complete example that showed me how to best implement it, but after looking at various examples I was able to pick out the bits that worked for my app. I ended up with something very close to this <http://article.gmane.org/gmane.comp.web.catalyst.general/11887>.

Best practices say to only store the info from $context that you need in your model rather than a reference to $context itself. IOW, if you just need the current user object, then just store that. I don't recall the reasoning for it though.

Charlie

--
   Charlie Garrison  <[EMAIL PROTECTED]>
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Reply via email to