NAME

Tatsumaki::Template::Markapl - Use Markapl as Tatsumaki's template system.

VERSION

version 0.3

DESCRIPTION

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.

SYNOPSIS

# 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
    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'});
    };

AUTHOR

Gea-Suan Lin, <gslin at gslin.org>

LICENSE AND COPYRIGHT

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.