From bdc9f5645259b14d442fda9909c69b5942e760a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Tue, 5 Jun 2012 15:53:08 -0700 Subject: [PATCH] Use app->renderer->paths to find template directories Closes #20 --- lib/Mojolicious/Plugin/TtRenderer/Engine.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Mojolicious/Plugin/TtRenderer/Engine.pm b/lib/Mojolicious/Plugin/TtRenderer/Engine.pm index 3a87e3f..e38b224 100644 --- a/lib/Mojolicious/Plugin/TtRenderer/Engine.pm +++ b/lib/Mojolicious/Plugin/TtRenderer/Engine.pm @@ -40,7 +40,10 @@ sub _init { # take and process options :-) my %config = ( - ($app ? (INCLUDE_PATH => abs_path($app->home->rel_dir('templates'))) : ()), + ( $app + ? (INCLUDE_PATH => (join ":", map { abs_path($_) } @{$app->renderer->paths})) + : () + ), COMPILE_EXT => '.ttc', COMPILE_DIR => ($dir || abs_path(File::Spec->tmpdir)), UNICODE => 1,