如何在yii2编辑器中插入初始值

如何在yii2编辑器中插入初始值,yii2,ckeditor,Yii2,Ckeditor,这是我的密码 我需要在编辑器中设置初始值,您应该在字段模板中指定一个值,例如在控制器/创建中 <?= $form->field($model, 'template')->widget(CKEditor::className(), [ 'options' => ['rows' => 100], 'preset' => 'full',

这是我的密码
我需要在编辑器中设置初始值,您应该在字段模板中指定一个值,例如在控制器/创建中

        <?= 
            $form->field($model, 'template')->widget(CKEditor::className(), [
                'options' => ['rows' => 100],
                'preset' => 'full',
                'value'=>'<p>Incercam sa editam</p>',
            ])->label(true)
        ?>
一旦你分配给你$model->template你需要的值,你应该在你的编辑器里看到这个

  public function actionCreate()
  {
      $model = new YourModel();


      if ($model->load(Yii::$app->request->post()) && $model->save()) {
          return $this->redirect(['view', 'id' => $model->id]);
      } else {
          $model->template ="your initila value ....... text "
          return $this->render('@common/views/antigone-contribuente/create', [
              'model' => $model,
          ]);
      }
  }