style switch in forech loop - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: style switch in forech loop (/showthread.php?tid=19071) |
style switch in forech loop - El Forum - 05-27-2009 [eluser]René Tuin[/eluser] Hi, I have a problem. I want to switch a style of a certain object. I have already done it with php only if I use the same code in CI i don't get any result. I've the following code in my view: Code: <?php Knows someone a solution to my problem. Greetz style switch in forech loop - El Forum - 05-27-2009 [eluser]Dam1an[/eluser] You could always use the alternator function in the string helper style switch in forech loop - El Forum - 05-27-2009 [eluser]jalalski[/eluser] If style is 'even', then you want to switch it to 'noeven' and vice-versa. Then it will work. HTH style switch in forech loop - El Forum - 05-27-2009 [eluser]René Tuin[/eluser] [quote author="Dam1an" date="1243428701"]You could always use the alternator function in the string helper[/quote] Thx Dam1an, That was the helper I was looking for, i didn't know that it was the string helper. Greetz style switch in forech loop - El Forum - 05-27-2009 [eluser]Dam1an[/eluser] Thats why there's a wonderful little search box I couldn't remember if it was string or text helper either lol style switch in forech loop - El Forum - 05-27-2009 [eluser]xwero[/eluser] Why need two classes if one is enough? You always have the normal style of the table row, table specific or not, and then you just add a class to the rows that need to have another style. Code: foreach($query as $i->$row) |