Tatsumaki::Template::Markapl - Use Markapl as Tatsumaki's template system.
version 0.3
This module will use Markapl as Tatsumaki's template system.
Tatsumaki do not support custom template engine currently, so we use Sub::Install to rewrite Template::Application::_build_template.
# This usually is in app.psgi use Tatsumaki::Template::Markapl; # Install the template system Tatsumaki::Template::Markapl->rewrite('MyProj::View');
And then in MyProj::View:
MyProj::View
# MyProj::View package MyProj::View; use Markapl; template '/' => sub { my $self = shift; html { head { title { 'My Title' }; }; body { div('#bd') { outs('Hello, '); outs($self->get('name')); }; }; }; };
Now you can use it in handler:
# MyProj::Handler::Index package MyProj::Handler::Index; use parent 'Tatsumaki::Handler'; sub get { shift->render('/', {name => 'perl'}); };
Gea-Suan Lin, <gslin at gslin.org>
<gslin at gslin.org>
Copyright 2011 Gea-Suan Lin.
This software is released under 3-clause BSD license. See http://www.opensource.org/licenses/bsd-license.php for more information.
To install Tatsumaki::Template::Markapl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tatsumaki::Template::Markapl
CPAN shell
perl -MCPAN -e shell install Tatsumaki::Template::Markapl
For more information on module installation, please visit the detailed CPAN module installation guide.