我使用curd来显示CGridview我在我的计算机中加入了2个表吗
但是当部署到linux服务器时不能正常工作有什么不对? ,帮帮我! 控制器中的
myController
$model=new UserLogin('search');
$model->unsetAttributes();
$dataProvider = new CActiveDataProvider('UserLogin', array(
'criteria' => array(
'with'=>'group',
),
'pagination' => array(
'pageSize' => 20,
),
));
$this->render('admin', array(
'dataProvider'=>$dataProvider,'model'=>$model)
);
此错误
Invalid argument supplied for foreach()
/data/home/nueng/www/html/framework/db/ar/CActiveFinder.php(466)
454
455 /**
456 * Performs lazy find with the specified base record.
457 * @param CActiveRecord $baseRecord the active record whose related object is to be fetched.
458 */
459 public function lazyFind($baseRecord)
460 {
461 if(is_string($this->_table->primaryKey))
462 $this->records[$baseRecord->{$this->_table->primaryKey}]=$baseRecord;
463 else
464 {
465 $pk=array();
466 foreach($this->_table->primaryKey as $name)
467 $pk[$name]=$baseRecord->$name;
468 $this->records[serialize($pk)]=$baseRecord;
469 }
470
答案 0 :(得分:0)
嗯,您只是猜测您是否尊重group
条件中型号名称with
中的案例?
Linux区分大小写,因此如果您在关系名称或关系的型号名称中放置group
而不是Group
,则可能会发生错误。