pinsn
- pinsn 回复了话题 控制器中的admin方法,怎么用条件过滤
public function actionAdmin($id) { $model=new test(); $model->unsetAttributes(); // clear any default values if(isset($_GET['test'])) $model->attributes=$_GET['test']; $this->render('admin',array( 'model'=>$model, )); }
这样是全部输出我,我想传一个ID过去,只列表pid为ID的列
舰长啊你辛苦了
<?php echo $form->dropDownList($model,'id',A::model()->getList);?>
模块A中的方法是这样public function getList(){ return CHtml::listData($this->findAll(array('order'=>'id desc'),'id','name')); }
运行时提示以下错误
include(a.php): failed to open stream: No such file or directory
我已经把模块A中的模型写在import里了