欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

为什么activitieDropdownlist的值始终无法获取到?

程序员文章站 2024-02-04 09:00:28
...
本帖最后由 sincor 于 2013-06-22 18:17:19 编辑 视图层view





控制器层

	public function actionDbdplist()	{    $m_subjectlist = new SubjectList();    $m_gradelist = new Grade;    $this->subject_list = SubjectList::model()->findAll();     $this->grade_list = Grade::model()->findAll();                                         	//使用findAll 得到的结果是数据对象所以这样小小处理一下吧他们转换成数组:    foreach($this->subject_list as $item)	{         $sb_list[$item->subject_id] = $item->subject_name;    }    foreach($this->grade_list as $item)	{         $gd_list[$item->grade_id] = $item->grade_name;    }	$result=$_POST['subject_name'];	    $this->render('dbdplist',array(               'm_subjectlist' => $m_subjectlist,               'm_gradelist' => $m_gradelist,               'subject_list'=>$this->subject_list,               'grade_list'=>$this->grade_list,               'sb_list'=>$sb_list,               'gd_list'=>$gd_list,               'result'=>$result,		'model'=>$model,));			   }	

回复讨论(解决方案)

看一下 CHtml::activeDropDownList 的定义