sub my_route { my $app = shift $app->res->template('my_template', { r => $app->res }); }
Then, in your template you could do something in the lines of:
<a href="[% r.url('home') %]">Homepage</a>Stefan
If you're using an advanced template engine, such as Template::Toolkit, you could just pass the response object to the template, then build your URLs within it.sub my_route { my $app = shift $app->res->template('my_template', { r => $app->res }); }Then, in your template you could do something in the lines of:<a href="[% r.url('home') %]">Homepage</a>