[Catalyst] Store something in the stash at startup

Charlie Garrison garrison at zeta.org.au
Tue Aug 17 06:27:22 GMT 2010


Good afternoon,

On 17/08/10 at 8:27 AM +0300, Octavian Rasnita <octavian.rasnita at ssifbroker.ro> wrote:

>$c->stash(menu => $c->model('Menu'));
>
>But this would re-create the menu object on each request, and this takes time.
>
>The data structure of the menu is loaded only at startup by the do() in the configuration file, but 
>then it is used on each request to re-create the menu object.

Are you looking for this:

http://search.cpan.org/perldoc?Catalyst::Model::Adaptor

Specifically:

    "Note that NotMyApp::SomeClass is instantiated at application startup time."


Charlie

-- 
   Ꮚ Charlie Garrison ♊ <garrison at zeta.org.au>
   
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt



More information about the Catalyst mailing list