/**
  * Creates a new Providers model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Providers();
     $modelOptions = new OptionsProvider();
     if ($modelOptions->load(Yii::$app->request->post()) && $modelOptions->validate()) {
         $model->name = $modelOptions->name;
         $model->options = BaseJson::encode($modelOptions->attributes);
         $model->save();
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model, 'modelOptions' => $modelOptions]);
     }
 }