/**
  * Creates a new PrefixCapability model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new PrefixCapability();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         echo 1;
     } else {
         return $this->renderAjax('create', ['model' => $model]);
     }
 }
 public function actionCreateVirtual()
 {
     $model = new Prefix();
     $modelPrefixCapability = new PrefixCapability();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         GlobalFunctionController::activity_user("[CREATE PREFIX] Prefix : {$model->prefix} ,Description : {$model->description}, Virtual : {$model->virtual_id}, Type : {$model->type}");
         Yii::$app->Controllers->historyUserWithData($model);
         if ($model->codec_type != "") {
             $modelPrefixCapability->prefix_id = $model->id;
             $modelPrefixCapability->codec_type = $model->codec_type;
             $modelPrefixCapability->save();
         }
         echo 1;
         //return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->renderAjax('create_virtual', ['model' => $model]);
     }
 }