Re: [SMARTY] help me with Date_Calc and Smarty
| From: | Sn!per | Date: | Fri, 22 Aug 2003 08:03:20 +0000 |
| Subject: | Re: [SMARTY] help me with Date_Calc and Smarty | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10107@lists.php.net to get a copy of this message | ||
[blushed] i should have mentioned that i want to generate the calendar for the whole month of
august. and yes i have done a print_r($calmon) before. the output looks good.
but what i received is way out of my intention. i refer to the manpages and stumped across nested
section. BUT the more i read and cross-referenced postings in the archive, just made me more
confused :)
:)) pls help.
--
Quoting messju mohr <messju@lammfellpuschen.de>:
> 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.
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/
---------------------------------------------------