Catalyst Template :: Toolkit Output

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!

+5
source share
1 answer

$c->forward( $class, $method, [, \@arguments ] )- correct syntax for direct method from Catalyst

Therefore, you should write like this:

my $content = $c->forward($c->view('HTML'), "render", [ $template_name ]);

+6
source

All Articles