我已经创建了一个关系请求页面,现在我遇到的问题是,当我激活一个关系时,它会继续显示在视图中。我只希望显示字段 active = false 的请求。
这是我的请求控制器,它由于数组而崩溃,我该如何解决这个问题?
public function request(){
$this->set('title_for_layout', 'Relationships');
$this->set('stylesheet_used', 'homestyle');
$this->set('image_used', 'eBOXLogoHome.jpg');
$this->layout='home_layout';
$userid = $this->Auth->user('username');
$this->set('Relationships', $this->Relationship->find('all', array('conditions' => array('Relationship.partytwo' => $userid)) array('conditions'=>array('Relationship.active'=false))));
}
对于咯咯笑,这是我的观点
<?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($relationship['Relationship']['partyone'], array('action'=>'approve', $relationship['Relationship']['id'])); ;?>
</td>
</tr>
<?php endforeach; ?>
</table>