- Added additional_template_paths stash param patch from zby
[catagits/Catalyst-View-TT.git] / t / lib / TestApp.pm
index 12d9bc0..618a5fd 100755 (executable)
@@ -4,6 +4,7 @@ use strict;
 use warnings;
 
 use Catalyst; # qw/-Debug/;
+use Path::Class;
 
 our $VERSION = '0.01';
 
@@ -32,6 +33,16 @@ sub test : Local {
     $c->stash->{message} = ($c->request->param('message') || $c->config->{default_message});
 }
 
+sub test_includepath : Local {
+    my ($self, $c) = @_;
+    $c->stash->{message} = ($c->request->param('message') || $c->config->{default_message});
+    $c->stash->{template} = $c->request->param('template');
+    if ( $c->request->param('additionalpath') ){
+        my $additionalpath = Path::Class::dir($c->config->{root}, $c->request->param('additionalpath'));
+        $c->stash->{additional_template_paths} = ["$additionalpath"];
+    }
+}
+
 sub end : Private {
     my ($self, $c) = @_;