Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Catalyst::View::JemplaUser)Contributed Perl DocumenCatalyst::View::Jemplate(3)

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

	 # To specify which files you want to include
	 sub select : Global {
	     my($self, $c) = @_;
	     $c->stash->{jemplate} = {
		 files => [ 'foo.tt', 'bar.tt' ]
	     }
	 }

	 # To serve Jemplate rutime
	 sub runtime : Path('Jemplate.js') {
	     my($self, $c) = @_;
	     $c->stash->{jemplate} = {
		 runtime => 1,
		 files	 => [],	 # runtime only
	     }
	 }

	 # To use caching
	 use Catalyst qw(
	     ...
	     Cache
	 );

	 MyApp->config(
	     cache => {
		 backends => {
		     jemplate => {
			 # Your	cache backend of choice
			 store => "FastMmap",
		     }
		 }
	     }
	 );

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>

       When Catalyst::Plugin::Cache is enabled,	this plugin make uses of it to
       cache the compiled output and serve files.

TODO
       o   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<>

POD ERRORS
       Hey! The	above document had some	coding errors, which are explained
       below:

       Around line 183:
	   You forgot a	'=back'	before '=head1'

       Around line 192:
	   An empty L<>

perl v5.32.0			  2007-05-04	   Catalyst::View::Jemplate(3)

NAME | SYNOPSIS | DESCRIPTION | TODO | AUTHOR | SEE ALSO | POD ERRORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Catalyst::View::Jemplate&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help