Re: embedd PHP-Code in a template

From: Date: Sun, 03 Mar 2002 18:22:10 +0000
Subject: Re: embedd PHP-Code in a template
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2927@lists.php.net to get a copy of this message
Jochen Kaechelin wrote:
Thanx. It works now. I just found the part in the manual. It says that is not recommended to use PHP this way - but what's the problem when I use such a small snipplet like {php} echo date("Y:m:d"); {/php} and would be the best way to embed such a small php-code? You can actually do that using a Smarty bulit in function / reserved variable:
{$smarty.now|date_format:"%Y:%m:%d"} See this page of the manual: http://www.phpinsider.com/php/code/Smarty/docs/language.variables.smarty.html Cheers, Simon

« previous php.smarty.general (#2927) next »