Yii2 passing value from view to controller

     

I have this kind of problem. I have an input text that have template of radio in it.


the problem is that I want to get the value of that radio when I check it and store it to the database field.


my idea is to create a variable from model but i can't pass the radio value to that variable when i save it.


please help me I am stuck with it.


here is the images of view:


(image)


Controller action:


public function actionCreate()   {   $model = new QbQuestion();
if ($model->load(Yii::$app->request->post())) {   $answer = $model->answer;   $model->$answer;   $model->save();   return $this->redirect(Url::to(['qb-question/index']));   } else {   return $this->renderAjax('create' [   'model' => $model   ]);   }   }  

View:



'horizontal'