php-Anweisung in tpl einfügen

Danny1973

B1G-Software-Kunde
#1
Huhu,

ich würde gern folgende php-Anweisung in die index.tpl im Ordner nli in templates einfügen:

<?php = date("Y"); ?>

Leider wird das aktuelle Jahr nicht angezeigt.
Habe einen Server, welcher php5 als fast-cgi-Applikation nutzt.

In der htaccess:

AddHandler x-httpd-php5 .php .php5 .htm .html .tpl
AddHandler php5-cgi .php .php5 .htm .html .tpl
AddHandler php-cgi2 .php .php5 .htm .html .tpl
AddHandler php-fastcgi5 .php .php5 .htm .html .tpl
AddType x-mapp-php5 .php .php5 .htm .html .tpl
AddType application/x-httpd-php5 .php .php5 .htm .html .tpl

alles versucht. Aber nichts führt zum gewünschten Ergebnis. Hat jemand einen Tipp?

Vielen Dank.
Liebe Grüße Danny
 

patrick

Staff member
B1G-Software-Kunde
#2
Smarty-Templates sind keine PHP-Dateien, mit dem {php}{/php}-Tag kannst du aber PHP-Code einbinden.

Code:
{php} echo date("Y"); {/php}
 
Top