Ejemplo n.º 1
0
 /**
  * Creates a new Theme model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $themeModel = new Theme();
     $forms = Form::find()->select(['id', 'name'])->asArray()->all();
     if ($themeModel->load(Yii::$app->request->post()) && $themeModel->save()) {
         Yii::$app->getSession()->setFlash('success', Yii::t('app', 'The theme has been successfully created.'));
         return $this->redirect(['view', 'id' => $themeModel->id]);
     } else {
         return $this->render('create', ['themeModel' => $themeModel, 'forms' => $forms]);
     }
 }
Ejemplo n.º 2
0
 /**
  * @param $inputs
  */
 public function store($inputs)
 {
     $theme = new Theme();
     $theme->fill($inputs);
     $theme->save();
 }