private function fetchWYSIWYG() { $data = app\modules\core\models\Wysiwyg::getClassNameAndParamsById($this->wysiwyg_id); if (!isset($data['class_name'])) { if ($this->wysiwyg_id > 1) { $this->wysiwyg_id = 1; } else { Yii::$app->cache->delete('WysiwygClassName:' . $this->wysiwyg_id); } return $this->fetchWYSIWYG(); } $this->wysiwyg_class_name = $data['class_name']; $this->wysiwyg_params = $data['params']; }
public function down() { Wysiwyg::deleteAll(['class_name' => 'app\\widgets\\TextareaWidget']); return true; }
echo $form->field($model, 'serverName'); ?> <?php echo $form->field($model, 'serverPort'); ?> <?php echo $form->field($model, 'composerHomeDirectory'); ?> <?php echo $form->field($model, 'internalEncoding'); ?> <?php echo $form->field($model, 'autoCompleteResultsCount'); ?> <?php echo $form->field($model, 'wysiwyg_id')->dropDownList(\app\modules\core\models\Wysiwyg::itemsForSelect()); ?> <?php echo $form->field($model, 'fileUploadPath'); ?> <?php echo $form->field($model, 'removeUploadedFiles')->widget(SwitchInput::className()); ?> <?php echo $form->field($model, 'overwriteUploadedFiles')->widget(SwitchInput::className()); ?> <?php echo $form->field($model, 'daysToStoreSubmissions'); ?> <?php BackendWidget::end();
/** * Finds the Wysiwyg model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Wysiwyg the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Wysiwyg::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }