NAME

Catalyst::View::Jemplate - Jemplate files server

SYNOPSIS

package MyApp::View::Jemplate;
use base qw( Catalyst::View::Jemplate );

package MyApp;

MyApp->config(
    'View::Jemplate' => {
        jemplate_dir => MyApp->path_to('root', 'jemplate'),
        jemplate_ext => '.tt',
    },
);

sub jemplate : Global {
    my($self, $c) = @_;
    $c->forward('View::Jemplate');
}

DESCRIPTION

Catalyst::View::Jemplate is a Catalyst View plugin to automatically compile TT files into JavaScript, using ingy's Jemplate.

Instead of creating the compiled javascript files by-hand, you can include the file via Catalyst app like:

<script src="js/Jemplate.js" type="text/javascript"></script>
<script src="/jemplate/all.js" type="text/javascript"></script>

TODO

  • Yeah, we definitely need a cache. For now it compiles templates in every request, which is not very efficient.

  • Right now all the template files under jemplate_dir is compiled into a single JavaScript file and served. Probably we need a path option to limit the directory.

AUTHOR

Tatsuhiko Miyagawa <miyagawa@bulknews.net>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

L<>

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 105:

You forgot a '=back' before '=head1'

Around line 114:

An empty L<>