[Catalyst] How to access current MyApp instance ?

Matt S Trout dbix-class at trout.me.uk
Sun Jul 1 16:08:03 GMT 2007


On Sun, Jul 01, 2007 at 05:51:50PM +0400, Oleg Pronin wrote:
> Because [%Game.detailsHref%] or [%Game.historyHref%] is much easier and
> faster to call then
> [%INCLUDE game_hrefs game=Game type='details'%]
> 
> As a temporary fast solution i use this:
> in root controller's auto action:
> MyApp->c($c);
> weaken(MyApp->c);
> 
> from anywhere: $c = MyApp->c;

Congratulations, you just reinvented Catalyst::Plugin::Singleton.

You should still be using ACCEPT_CONEXT though.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 



More information about the Catalyst mailing list