Re: [SMARTY] date_format
| From: | Monte Ohrt | Date: | Mon, 13 Jan 2003 21:30:50 +0000 |
| Subject: | Re: [SMARTY] date_format | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7151@lists.php.net to get a copy of this message | ||
date_format can take an optional second parameter, the value to display
if the date is empty:
{$empinfo[1]|date_format:"%d %B %Y":""}
should display nothing.
On Mon, 2003-01-13 at 12:33, Joel Lord wrote:
> Hi everyone,
> I have another newbie question ;). I have a variable named
> $empinfo[1] that is passed to my .tpl file by my .php file. This file
> may contain a date but may also be empty. I need to format it on my
> template so I use the following command:
> {$empinfo[1]|date_format:"%d %B %Y"}
> The problem is that when it's empty, it prints out today's date. I know
> I could use a {if}.{/if} but I need (if possible, of course) to use only
> one tag so I must avoid ifs.
>
> Thanks a lot for your help,
> Joel Lord
--
Monte Ohrt <monte@ispi.net>