i have like this code in myController{
public function actionCreate(){
// some code
if($var > 0){
$model->actionID = $result
$model->comment = $anothervalue;
}else{
$model->actionID = $anotherresult;
$model->comment = $anothervalue;
}
in order to make the code more readable, i create in the controller a function
public function PutValue($actionvalue , $commentValue){
$model = new my();
$model->actionID = $actionvalue;
$model->comment = $commentValue;
}
and then the action create will be
public function actionCreate(){
// some code
if($var > 0){
$this->PutValue($actionvalue , $commentValue);
}else{
$this->PutValue($anotheractionvalue , $anothercommentValue);
}
the values was saved in the database as NULL, i just removed the worked code in another function
can anyone tell me the cause?