Thread HTML::Template: und Hyperlinks (3 answers)
Opened by pktm at 2004-12-30 01:29

pktm
 2004-12-30 02:37
#639 #639
User since
2003-08-07
2921 Artikel
BenutzerIn
[Homepage]
user image
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
# main_template aus DB lesen
my $statement = "SELECT template FROM template WHERE name='main_template'";
my $sth = $dbh->prepare($statement)          || die $dbh->errstr;
unless( my $rv = $sth->execute ){ die "Konnte main_template nicht aus Datenbank lesen"; }
my $template = HTML::Template->new(arrayref => $sth->fetchrow_arrayref() );
$sth->finish();

# self füttern
$template->param(SELF => $cgi->url(-relative=>1) . '?sid=' . $query->{sid});

# Ausgabe
print $template->output;


Das Template:
[html]
<h1>Login erfolgreich!</h1>
<ul>
<li>
<a href=" <TMPL_VAR NAME=SELF> ">weiter &gt;&gt;</a>
</li>
</ul>[/html]
http://www.intergastro-service.de (mein erstes CMS :) )

View full thread HTML::Template: und Hyperlinks