Re: [SMARTY] help me with Date_Calc and Smarty

From: Date: Fri, 22 Aug 2003 08:03:18 +0000
Subject: Re: [SMARTY] help me with Date_Calc and Smarty
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10106@lists.php.net to get a copy of this message
On Fri, Aug 22, 2003 at 03:18:52PM +0800, Sn!per wrote: > php script: > <? > require_once "smarty/Smarty.class.php"; > require_once "Date/Calc.php"; > > $tpl = new Smarty; > $cal = new Date_Calc; > > $calmon = $cal->getCalendarMonth(8,2003); > > $tpl->assign("days",$calmon); > $tpl->display("calmon.tpl"); > > ?> > > smarty's template: > <table border="1" cellpadding="2" cellspacing="0" > width="100%"> > {section name=num loop=$days} > <tr> > <td>{$days[num][0]} > </td> > </tr> > {/section} > </table> > > > ouput: > 20030728 > 20030804 > 20030811 > 20030818 > 20030825 > > i am really confused. pls advise. tia in your php do "print_r($calmon);" to examine and understand what $cal->getCalendarMonth() returns. in the template do "{$days[num][0]|date_format}" to convert the canonified "YYYYMMDD"-dates to common human formats.

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