$this->layout='defaultall';
$id = $this->Auth->user('idUser');
$data= $this->Contact->find('all',array(
'conditions' => array('Contact.User_id' => $id)));
$this->set('contacts',$data);
$this->loadModel('Calllog');
/* for($i=1; $i < 2; $i++)
{
$mobile =$data[$i]['Contact']["mobileNo"];
$work =$data[$i]['Contact']["workNo"];
$home =$data[$i]['Contact']["homeNo"];*/
for($data as $datas){
$mobile= $datas['Contact']['mobileNo'];
$home= $datas['Contact']['homeNo'];
$work= $datas['Contact']['workNo'];
$recent=$this->Calllog->find('all',
array('order'=>'Calllog.idCallLog DESC',
'limit' => 1,
'conditions' => array('Calllog.mobileNo' => array($mobile,$work,$home ),
'Calllog.User_id' => $id
)));
//here array want to declare
$this->set('a',$recent);
//在这里我想声明一个保存每次迭代数据的另一个数组..因为我不想覆盖数据
抱歉,我在数组中待了一个星期……请告诉我如何打印数组……如果我想在我的视图页面中显示第一次迭代结果