Hi folks,
I'm learning PHP and CakePHP and I have a problem with the following code. When I execute it (with WAMP: PHP 5.3.0, Apache 2.2.11 and MySql 5.1.36) appears a parse error in the line of endforeach. Somebody knows what is happend? All the documentation I read it says that the endforeach; is legal but... I have a problem :-(
Thanks in advance and have a nice day! Oscar.
<?php foreach($tasks as $task): ?>
<tr>
<td><?php echo $task['Task']['title']; ?></td>
<td>
<?php if($task['Task']['done']): echo "Done";
else: echo "Pending";
?>
</td>
<td><?php echo $task['Task']['created']; ?></td>
<td><?php echo $task['Task']['modified']; ?></td>
<td></td>
</tr>
<?php endforeach; ?>
Edited: added the colon after the foreach(..)