RE: [SMARTY] html_select_date and foreach
| From: | Chris N | Date: | Sun, 30 Mar 2003 18:57:31 +0000 |
| Subject: | RE: [SMARTY] html_select_date and foreach | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8996@lists.php.net to get a copy of this message | ||
I hadnt tried the cat modifier, worked perfectly. Thanks a lot.
Chris N
-----Original Message-----
From: messju mohr [mailto:messju@lammfellpuschen.de]
Sent: Sunday, March 30, 2003 5:51 AM
To: Chris N
Cc: smarty
Subject: Re: [SMARTY] html_select_date and foreach
Hello,
On Sun, Mar 30, 2003 at 01:06:52AM -0500, Chris N wrote:
> ok I've run into a problem regarding html_select_date within a foreach
loop
> (same problem within a section). Anyway here's the problem.
>
> {foreach from=$assoc item=info}
> {html_select_date time=$info.startYear-00-00 start_year="-45"
> display_days=false display_months=false}
> {/section}
>
> that's just the problem segment. I actually went in and had the $time
print
> out within the function.html_select_date.php and the output is
> Array.startYear-00-00 so you can see that the actual value is not being
> passed. I've tried every variation I can think of from quoting the string
to
> trying to concatenate it within the html_select_date. Anyone have this
> problem before or can think of a way out of it.
did you really try to concatenate it?
{foreach from=$assoc item=info}
{html_select_date time=$info.startYear|cat:"-00-00" start_year="-45"
display_days=false display_months=false}
{/foreach}
should work.
if you think c you can also do: time="%d-00-00"|sprintf:$info.startYear
have fun
messju
> update:
> I have been able to bypass the problem by using assign within the template
> but that seems to be such a kludge. I'm working with some pretty extensive
> forms that will have up to 10 date fields on the page so I'd like to find
a
> better way to handle it.
>
> Chris N
>
--
Stockoptions: Die Geschäftsleitung behält sich vor, die Prügelstrafe
einzuführen.
Manfred Worm
Schäfer