
yogaboy
Novice
Jun 8, 2009, 2:28 PM
Post #1 of 9
(678 views)
|
|
Template Toolkit not finding templates
|
Can't Post
|
|
Hi, I try running the following (snippet of) code within a CGI page, and it produces the error beneath. What I don't understand is, it all works if I put the templates in the same dir as the cgi, or if I use ttree. The docs aren't clear on where the INCLUDE_PATH begins (server root, webserver root, current dir...?) but I've tried absolute paths, relative, tild... every way I can think of. I don't know how get any more information to help debug, I got the stack trace using use CGI::HTMLError trace => 1; Any help is much appreciated.
my $form = CGI::FormBuilder->new( name => 'books' ,fields => \@fields ,validate => { title => 'VALUE' ,author => '/\w+\s+\w+.*/' ,pages => 'INT' ,owners => 'INT' } ,method => 'post' ,template => { type => 'TT2' ,template => 'BookInsert.tt' ,variable => 'form' ,INCLUDE_PATH => [ #main.config filr in ttreerc dir '~/Sites/templates/ttreerc/' #BooksInsert.tt in src dir ,'~/Sites/local.main.local/templates/src' #headers and footers in lib dir ,'~/Sites/local.main.local/templates/lib' ,'~/Sites/local.main.local/templates/dest' ], # pre-process lib/config to define any extra values ,PRE_PROCESS => 'main.config' } );
[FormBuilder] Fatal: file error - BookInsert.tt: not found at /usr/local/lib/perl5/site_perl/5.8.8/CGI/FormBuilder.pm line 1530
|