Why is the value of Activitiedropdownlist not always available?
This post was last edited by Sincor on 2013-06-22 18:17:19
Views Layer View
Controller layer
Public Function Actiondbdplist ()
{
$m _subjectlist = new Subjectlist ();
$m _gradelist = new Grade;
$this->subject_list = Subjectlist::model ()->findall ();
$this->grade_list = Grade::model ()->findall ();
The result of using FindAll is a data object so just deal with it a little bit. They convert the array:
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,));
}