Thread HTML::Template include: tmpl-file via parameter festlegen (21 answers)
Opened by styx-cc at 2006-07-07 19:14

styx-cc
 2006-07-07 23:29
#8245 #8245
User since
2006-05-20
533 Artikel
BenutzerIn

user image
Ich versuchs mal zu erklaeren, is nich ganz einfach..
Also, folgendes funktioniert nicht:

Main CGI:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!G:\perl\bin\perl
use strict;
use warnings;

use CGI::Carp qw(fatalsToBrowser);

use HTML::Template::Compiled;

my $tmpl = HTML::Template::Compiled->new(filename =>'../templates/main.tmpl');


$tmpl->param(content => '../templates/test.tmpl');

print "Content-type: text/html\n\n";
print $tmpl->output();


Include im Tmpl:
Code: (dl )
<!-- TMPL_INCLUDE_VAR NAME="content" -->

'../templates/test.tmpl' not found at G:/programmierung/web/stefan/cgi-bin/navi.cgi line 15


Allerdings funktioniert:
Code: (dl )
<!-- TMPL_INCLUDE NAME="../templates/test.tmpl" -->


und gerade beim testen is mir aufgefallen,
wenn ich:
Code: (dl )
1
2
<!-- TMPL_INCLUDE_VAR NAME="content" -->
<!-- TMPL_INCLUDE NAME="../templates/test.tmpl" -->


nehme, includiert ers 2 Mal...

MfG

Edit:
Mit dem absoluten Pfad klappt <!-- TMPL_INCLUDE_VAR NAME="content" --> aber.\n\n

<!--EDIT|styx-cc|1152300788-->
Pörl.

View full thread HTML::Template include: tmpl-file via parameter festlegen