Mutant has asked for the wisdom of the Perl Monks concerning the following question:
Of course, you don't *have* to do it that way, especially since forward() now supports passing of arguments. But a lot of the Catalyst::* modules do things like (from Catalyst::View::HTML::Template for use with HTML::Template):sub foo : Local { my ($self, $c) = @_; $c->stash->{foo} = 'store some stuff'; $self->forward('bar'); } sub bar : Private { my ($self, $c) = @_; # ... do something with data put in stash by foo() }
It seems most of the other view modules take this sort of a approach as well.$template->param( base => $c->req->base, name => $c->config->{name}, %{ $c->stash } );
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Catalyst and the stash
by agrundma (Novice) on Jul 19, 2005 at 19:31 UTC | |
Re: Catalyst and the stash
by phaylon (Curate) on Jul 19, 2005 at 18:53 UTC | |
by Mutant (Priest) on Jul 20, 2005 at 08:26 UTC | |
Re: Catalyst and the stash
by perrin (Chancellor) on Jul 19, 2005 at 19:41 UTC | |
Re: Catalyst and the stash
by revdiablo (Prior) on Jul 19, 2005 at 18:53 UTC | |
by jest (Pilgrim) on Jul 19, 2005 at 20:06 UTC | |
Re: Catalyst and the stash
by astroboy (Chaplain) on Jul 19, 2005 at 19:55 UTC | |
by samtregar (Abbot) on Jul 19, 2005 at 20:25 UTC | |
by astroboy (Chaplain) on Jul 20, 2005 at 02:56 UTC | |
Re: Catalyst and the stash
by monsieur_champs (Curate) on Jul 20, 2005 at 12:47 UTC |