Welcome Guest, Not a member yet? Register   Sign In
style switch in forech loop
#1

[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
$style = "even";
foreach($query as $row)
{
echo '<li id="listItem_'. $row->id .'" class="'.$style.'">
<div class="info"><b>'. $row->naam.'</b><br />'. $row->omschrijving.'</div>
</li>';

switch($style)
{
  case 'even': $style = 'even';
  break;
  case 'oneven': $style = 'oneven';
  break;                
}
}
?&gt;


Knows someone a solution to my problem.

Greetz


Messages In This Thread
style switch in forech loop - by El Forum - 05-27-2009, 01:40 AM
style switch in forech loop - by El Forum - 05-27-2009, 01:51 AM
style switch in forech loop - by El Forum - 05-27-2009, 02:18 AM
style switch in forech loop - by El Forum - 05-27-2009, 02:31 AM
style switch in forech loop - by El Forum - 05-27-2009, 02:33 AM
style switch in forech loop - by El Forum - 05-27-2009, 02:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB