I am using Catalyst with Template :: Toolkit as my template system. I would like to be able to display certain parts of the templates and then return them to me so that I can store them in a variable. The documentation of Template :: Toolkit says that you can do it like this:
my $content = $c->forward($c->view('HTML'), "render", $template_name);
However, when I do this, I just get this error:
file error - : not found
Does anyone know what I'm doing wrong? Thank!
$c->forward( $class, $method, [, \@arguments ] )- correct syntax for direct method from Catalyst
$c->forward( $class, $method, [, \@arguments ] )
Therefore, you should write like this:
my $content = $c->forward($c->view('HTML'), "render", [ $template_name ]);