Im new to YII, and i'm facing this issue when customizing the _form of my view Recordbook:
<?php echo $form->labelEx($model,'subject'); ?>
<?php
$teacher_id='AC0001';//hardcoded the value for testing
echo $form->dropDownList($model, 'subject', $model->getSubjects($teacher_id), array('style' => 'width:200px;')); ?>
<?php echo $form->error($model,'subject'); ?>
The method gets executed fine... but the selected value is not taken when stored to the DB...
I have overridden the beforeSave() and found out that the method executes fine..
model
public function getClasses($grade){
$list= Yii::app()->db->createCommand('select distinct classId from schoolclasses where grade='.$grade.'')->queryAll();
$rs=array();
foreach($list as $item){
$rs[]=$item['classId'];
}
return $rs;
}
Is there anything wrong with this? i dont see why... please help...
Thankz! Cheerz!

Help














