Re: Limiting the section loop

From: Date: Tue, 26 Jun 2001 16:40:11 +0000
Subject: Re: Limiting the section loop
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-987@lists.php.net to get a copy of this message
On Tue, 26 Jun 2001, Anders Janson wrote: > Good to know, but this is not really a limit. It forces the loop to run N > times. > What I was looking for was a way to limit it to *max* N times. This does not > work properly if my data array(s) are shorter than N elements. Ok, then in order for us to implement it properly we should define precise behavior of this 'max' attribute. What should it do in the following cases: $input = array(1, 2, 3, 4); {section loop=$input max=0} {/section} {section loop=$input max=-4} {/section} {section loop=5 max=3} {/section} {section loop=5 max=0} ... {sectionelse} ... does this get shown when max <= 0? {/section} -Andrei When we eliminate the impossible, whatever remains, however improbable, must be true. -- Sherlock Holmes

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