[Catalyst] automatically setting template name to the last detached action

Zbigniew Lukasiak zzbbyy at gmail.com
Mon May 22 08:57:14 CEST 2006


Recently I discovered that using the SubRequest plugin is very
convenient for me in similar circumstances.  It sets the right
template and also it sets the base and uri_for to the right thing.

You use it like this:

$c->res->body( $c->subreq( '/some_action', { some_stash_val => $some_val } ) );

Zbigniew Lukasiak

On 5/21/06, marcus <marcus.baker at gmail.com> wrote:
> $c->stash->{template} seems to automatically get set to the name of
> the requested action (using the TT view at least) -- a request for the
> url '/artist/save' sets {template} to 'artist/save'.
> This is great, but I was wondering if there's a way to have {template}
> automatically get set to the last detached action (if there is one) as
> opposed to just the initially requested action.
> For example, say a user submits to /artist/save, and there's invalid
> data so they get detached to /artist/edit, {template} would in the end
> be 'artist/edit'.
> Infeasible?  Any plugins or suggested ways of going about this?
> -Marcus Baker
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst

More information about the Catalyst mailing list