[Catalyst] Making pages within pages

Paul Makepeace paulm at paulm.com
Tue Aug 1 05:18:04 CEST 2006


I have an ordinary Cat app that needs to generate some subsidiary
status output to a file that's then linked to in the main page's
output. Originally I was going to do all the Template process etc
myself but then wondered if there was a 'blessed' way of exploiting
the catalyst machinery. Here's what I came up with,

	my ($self, $c) = @_;
	my $template = $c->stash->{template};
	$c->stash->{template} = 'news/subpage';
	$c->forward('View::TT');
	render_somewhere('news/status' => $c->response->out);
	$c->response->output(''); # so the view is re-rendered
	$c->stash->{template} = $template;
        $c->stash->{status_page} = 'news/status';

What's nice about this is that news/subpage is found by catalyst - I'm
wondering how much of render_somewhere() cat could help with. Doesn't
have to follow that API, I just include that as an example; anything
that gets the data down on disk will do.

Paul



More information about the Catalyst mailing list