Home > Backend Development > PHP Tutorial > 为何activitieDropdownlist的值始终无法获取到

为何activitieDropdownlist的值始终无法获取到

WBOY
Release: 2016-06-13 11:45:59
Original
810 people have browsed it

为什么activitieDropdownlist的值始终无法获取到?
视图层view

<br /><br /><form method="post"><br />          <?php echo CHtml::activeDropDownList($m_subjectlist,'subject_name',$sb_list);?><br /> <div class="row submit"><br />     <?php echo CHtml::submitButton('显示我所选择的专业'); ?><br /> </div><br /> <?php  echo 'test'.$result.'111';?><br /> </form><br /><br /><br />
Copy after login



控制器层

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

------解决方案--------------------
看一下 CHtml::activeDropDownList 的定义

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template