Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: How to get the Catalyst Context object

by Your Mother (Archbishop)
on Nov 08, 2015 at 02:04 UTC ( [id://1147193]=note: print w/replies, xml ) Need Help??


in reply to How to get the Catalyst Context object

I agree that it tends to be design smell to need it but sometimes it's just the most natural way to solve a problem. I've done it three times, I think, and ended up taking one back when I realized my design error. This is the current best way to do it: Catalyst::Component::ApplicationAttribute.

# Moose extends etc with "Catalyst::Component::ApplicationAttribute"; sub somesub { my $self = shift; my $ctx = $self->_application; }

It handled handles the weakening properly and with the leading underscore emphasizes the private/dangerous nature of its usage.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1147193]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-24 08:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found