Sorry I hate to keep using this as a debugging place but I have no where else to go.
So I have this function to turn an object into a table row. I have put this in two different objects. But the problem is one works and one does not, despite being almost exactly identical.
Here is the working one.
else
{
$header = "<tr>";
$info = "<tr>";
foreach($this->data as $key => $item)
{
$header .= "<th>$key</th>";
$info .= "<td>$item</td>";
}//end foreach
$ret .= ($heads) ? "$header</tr>$info</tr>" : "$info</tr>";
}//end else
Here is the one that does not work:
else
{
foreach($this->data as $key => $item)
{
$header = "<tr>";
$info = "<tr>$onFront";
if($key == "available")
{
$yesno = ($item) ? "Yes" : "No";
$header .= "<th>$key</th>";
$info .= "<td>$yesno</td>";
}
else
{
$header .= "<th>$key</th>";
$info .= "<td>$item</td>";
}//end else
}//end foreach
$ret .= ($heads) ? "$header</tr>$info $onEnd</tr>" : "$info $onEnd</tr>";
}//end else
As you can see the only difference is that the broken one has an if/else. Basically when I run the function in the second one I only get one column, the available column.
Thanks any help is very appreciated.