如何将获取的数据(在本例中为:)$arr
返回到我的视图(我可以像在表格中显示一样对其进行操作)。如果我在通过 ajax 处理的控制器操作中有这个:
public function actionFetchregularload(){
$criteria = new CDbCriteria;
$criteria->limit = 15;
$criteria->condition='semester = 2';
$criteria->select = array('subjCode','subjDesc','lec','lab','units');
$criteria->addSearchCondition('yrLvl', $_GET['yrlevel']);
$data = CompeProspectusA::model()->findAll($criteria);
$arr = array();
foreach ($data as $item){
$arr[] = array(
'subjcode' => $item->subjCode,
'subjdesc' => $item->subjDesc,
'lab' => $item->lab,
'lec' => $item->lec,
'units' => $item->units,
);
}
}