Re: [SMARTY-DEV] {counter} bug
| From: | messju mohr | Date: | Tue, 03 Jun 2003 13:23:30 +0000 |
| Subject: | Re: [SMARTY-DEV] {counter} bug | ||
| References: | 1 2 3 4 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1532@lists.php.net to get a copy of this message | ||
On Tue, Jun 03, 2003 at 02:56:31PM +0400, Konstantin A. Pelepelin wrote:
> On Tue, 3 Jun 2003 01:04:37 -0700, Bharat Mediratta <bharat@menalto.com>
> wrote:
>
> >
> >From: "messju mohr" <messju@lammfellpuschen.de>
> >...
> >>this should be fixed in cvs now. please test.
> >Ok, this fixes the off-by-one error. However, now the new code does not
> >return the counter number.
>
> Both versions (2.5.0 and CVS of Tue Jun 3 10:05:46 2003 GMT ) has some
> problems.
>
> Code:
>
> |{{counter name=c1 assign=index start=0 print=true}}<br>
> {{$index}}:{{counter name=c1}}:{{$index}} <br>
> {{$index}}:{{counter name=c1}}:{{$index}} <br>
>
> |{{counter name=c1 start=0 print=true}}<br>
> {{$index}}:{{counter name=c1}}:{{$index}} <br>
> {{$index}}:{{counter name=c1}}:{{$index}} <br>
>
> |{{counter name=c2 start=0 print=true}}<br>
> {{$index}}:{{counter name=c2}}:{{$index}} <br>
> {{$index}}:{{counter name=c2}}:{{$index}} <br>
>
>
>
> Output in 2.5.0:
>
> |
> 0::1 1::2 |
> 0::1 1::2 |
> 0::1 1::2
>
> See counter c2 inherits 'assign' attribute from c1 (3rd block)
>
> Output in CVS:
>
> |0
> 0::1 1::2 |3
> 3::4 4::5 |0
> 5:1:5 5:2:5 5:2:5
>
> Counter c2 works as expected.
> For c1 print=true should be ignored since 'assign' is used.
> 'start' value is not reset in 2nd block.
i agree, that start=0 should reset the counter, but why should the
value not be printet if you say {counter print=true} ??
> WBR,
> Konstantin A. Pelepelin
>
> --
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php