Just another Perl shrine | |
PerlMonks |
How to get the Catalyst Context objectby Sewi (Friar) |
on Nov 07, 2015 at 06:59 UTC ( [id://1147171]=perlquestion: print w/replies, xml ) | Need Help?? |
Sewi has asked for the wisdom of the Perl Monks concerning the following question: Dear monks, I need to access the current context object for a catalyst request outside of the controller and without passing it from the controller. A typical catalyst controller:
How to get $c in other modules without explicit passing it? My current solution is setting a global variable in my root controller... ...and accessing it as $MyApp::Controller::Root::C, but I'd prefer to use the "official" way and to be compatible with any Catalyst App without changing it. Thank you.
Back to
Seekers of Perl Wisdom
|
|