public function up() { $wysiwyg = new Wysiwyg(); $wysiwyg->class_name = 'app\\widgets\\TextareaWidget'; $wysiwyg->name = 'Textarea'; $wysiwyg->params = json_encode(['htmlOptions' => ['class' => 'form-control', 'style' => 'height: 200px;']]); $wysiwyg->save(); }
/** * Creates a new Wysiwyg model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Wysiwyg(); if ($model->load(\Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }