For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > February 2005 > Re: [SMARTY] Strange behavior w/ Smarty and PEAR:Pager









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] Strange behavior w/ Smarty and PEAR:Pager
CaptainE

2005-02-07, 9:02 pm

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?
>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com