Re: [SMARTY] Strange behavior w/ Smarty and PEAR:Pager
| From: | CaptainE | Date: | Mon, 07 Feb 2005 22:34:01 +0000 |
| Subject: | Re: [SMARTY] Strange behavior w/ Smarty and PEAR:Pager | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12231@lists.php.net to get a copy of this message | ||
Hi,
section works only with arrays with indexes and not with associative
arrays. if your Array is not indexed section will not work.
This is not a bug, it is the meant beheaviour of the funktions and well
documented on the manual pages.
Greetings Steffen
Am Montag, den 07.02.2005, 11:48 +0100 schrieb bob:
> I was working on getting PEAR::Pager working with Smarty when I ran
> into a strange behavior.
>
> In my template file I was using {section name=x loop=$data} to loop
> through my results. It worked but it would only produce the 1st page of
> results... if you clicked "next" to go to the next page of results, the
> page would load but no data was presented... you just got an empty
> template with no error message.
>
> Over on the PEAR mailing list I found a post from someone who had the
> exact same problem and a reply from someone else who suggested to use
> {foreach} instead of {section}.
>
> I tried it and it worked perfectly. My question is: is this a bug. If
> not, what's the difference between {section} and {foreach} that would
> cause this?
>