Cot::Plugin::TT - It is a Template::Toolkit View module for Cot framework.
use Cot;
use Cot::Plugin qw/TT/;
get '/' => sub {
my $self = shift;
$self->res->status(200);
$self->res->headers({'Content-Type' => 'text/html', charset => 'utf8'});
my $out = $self->tt->output('index.tmpl',{sample:'hello world!'});
$self->res->body($out);
};
Template file must be installed in $ENV{COT_ROOT}/tmpl dir.
my $out = $self->tt->output('index.tmpl',{sample:'hello world!'});
Cot::Plugin::TT - It is a Template::Toolkit View module for Cot framework.
Copyright (C) Yusuke Shibata
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Yusuke Shibata [email protected]