Good morning,
On 17/9/07 at 8:37 AM -0500, Jonathan Rockway <[EMAIL PROTECTED]> wrote:
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.
You can try mixing in Catalyst::Component::ACCEPT_CONTEXT. It will
handle the ACCEPT_CONTEXT magic and provide $c as $self->context for
you. The reason for not storing $context in your model is because it
will create a circular reference if you're not careful.
Catalyst::Component::ACCEPT_CONTEXT is careful, so you don't
need to
worry about that. :)
Thanks for that reference. That was one of the sources I looked
at, but I needed slightly different behaviour. I missed the
'weaken' stuff though. Reading up on that now.
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/