大家好,只是想知道您是否在 foreach 循环中打印出东西,您将如何对其进行编码,以便只有一组与该人有关的特定数据。例如,我希望它在我的关系表中的活动为 =false 或 0 时打印
这是我认为的当前代码。
<?php foreach($Relationships as $relationship):?>
<tr>
<td align='center'><?php echo $relationship['Relationship']['partyone']; ?></td>
<td align='center'><?php echo $relationship['Relationship']['partytwo']; ?></td>
<td> </td>
<td><?php echo $this->Html->link('approve', array('action'=>'approve', $relationship['Relationship']['id'])); ;?>
<td><?php echo $this->Html->link('Decline', array('action'=>'decline', $relationship['Relationship']['id'])); ;?>
</td>
</tr>
<?php endforeach; ?>