keep the stash (or other solution) persistent from module to module

19 views
Skip to first unread message

Andrei Doanca

unread,
Nov 29, 2011, 9:26:49 AM11/29/11
to Mojolicious
hey guys,
I'm new to mojolicious, and I'm developing a new app in it...so.. I
have a couple of questions
what I want to do is to print some content in some js tabs....both
static and dynamic from the action, and also from the template
now..I'll put some code here to explain a little bit better...

package NMSWeb::Test::Tabstrip;
...............................
$tab_strip->{stash} = $self->{stash};
$tab_strip->add_tab( "Content with controller & action", { namespace
=> "Test", controller => "Test1", action => "index"} );
etc....
1;


and another one
package NMSWeb::UI::TabStrip;
..........................
sub add_tab {
.....................
$object->{stash} = $stash;
$hash->{content} = $object->$action;
$object->{stash} = $old_stash;
...........
etc...
1;


well, the thing is...I have to send the stash also...for every tab
that I add, or call the stash from a particular controller/action that
I use ...every time I use it...
is there any way...to keep the stash for the whole app, and just call
the controller and action from anywhere...without calling the stash???
I know about the session() but I want to keep other stuff in it...
thank you


Reply all
Reply to author
Forward
0 new messages