Cycle view helper inside partialLoop

1 message Options
Embed this post
Permalink
umpirsky

Cycle view helper inside partialLoop

Reply Threaded More More options
Print post
Permalink
Hi.

I have partialLoop for rendering some table rows and I want to cycle two CSS classes in each loop. I tried but it looks like cycle is reinitialized and in each loop I get same value returned from cycle helper.

Later I came up with this code in loop partial phtml:

if ($this->partialCounter%2) {
        $class = 'class1';
} else {
        $class = 'class2';
}

Is there a way around this with cycle helper?

Regards,
Saša Stamenković