我有一個搜索控制器,將查找值,並根據應顯示報告的類型呈現的具體意見。發生了一件奇怪的事情。當我發出$ this-> render時,報告視圖不會呈現。 「抓所有的」 重定向行總是被渲染...代碼如下:CakePHP的2.0控制器渲染沒有工作,所有的時間
公共職能admin_printReport(){
if (isset($this->request->data['Reports'])) { $nons = $this->request->data['Reports']; $res = array(); // lets lookup the noncons..... foreach ($nons as $dat=>$vdat) { // skip the ones that are not checked if ($vdat == 0) { continue; } // this is the temporary array that holds all of the selected report numbers > $res[] = $dat; } $this->loadModel('Noncon'); $this->Noncon->recursion = 0; $results = $this->Noncon->find('all', array('conditions'=>array('Noncon.id'=>$res))); $this->set('results', $results); // lets do the selection now... if (isset($this->request->data['PS'])) { // Print summary $this->render('summary', 'print'); } elseif (isset($this->request->data['PD'])) { // Print detail $this->render('detail', 'print'); } elseif (isset($this->request->data['PDH'])) { // Print detail with history $this->render('detailhistory', 'print'); } } // catch all if the render does not work.... $this->redirect(array('controller'=>'noncons', 'action'=>'search','admin'=>true));
}
什麼想法?