HTML::Tmojo::SimpleHandler
# IN YOUR APACHE CONFIG DirectoryIndex index.tmojo index.html
<LocationMatch "\.tmojo$">
SetHandler perl-script
PerlHandler HTML::Tmojo::SimpleHandler
PerlSetEnv TMOJO_CACHE_DIR /tmp/mojo
</LocationMatch>
The SimpleHandler can be used to quickly deploy Tmojo to your apache/mod_perl environment. Simply adding the above code to your httpd.conf will allow Apache to serve any .tmojo documents in your htdocs as Tmojo templates.
=head1 OPTIONS
The SimpleHandler obeys the following environment variables:
SimpleHandler will look for its templates in this directory. If not specified, SimpleHandler will look for its templates in the apache document root.
This required setting tells SimpleHandler where to store compiled Tmojo templates. The directory must be writable by apache.
If specified, SimpleHandler will use this path to determine the container template on each requested template. This option will override any $TMOJO_CONTAINER specified within templates.
Normally, you would use this option to create a directory
level containment mechanism. For instance, by setting
TMOJO_DEFAULT_CONTAINER to container.tmojo^, you can
make the SimpleHandler use the deepest template named
container.tmojo as the container for the requested
template.
Will Conant <will@willconant.com>