123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- use yii\helpers\Html;
- use yii\widgets\ActiveForm;
- /* @var $this yii\web\View */
- /* @var $model common\models\Page */
- /* @var $form yii\widgets\ActiveForm */
- ?>
- <div class="box box-success">
- <div class="box-body">
- <?php $form = ActiveForm::begin(); ?>
- <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
- <?= $form->field($model, 'slug')->hint('谨慎修改,需和小程序端保持一致')->textInput(['maxlength' => true]) ?>
- <?= $form->field($model, 'content')->widget(\common\widgets\EditorWidget::className(), $model->isNewRecord ? ['type' => request('editor') ?: config('page_editor_type')] : ['isMarkdown' => $model->markdown]) ?>
- <div class="form-group form-submit">
- <?= Html::submitButton($model->isNewRecord ? '创建' : '更新', ['class' => 'btn btn-flat bg-maroon btn-block']) ?>
- </div>
- <?php ActiveForm::end(); ?>
- </div>
- </div>
- <?php $this->beginBlock('js') ?>
- <script>
- $(document).on('change', '#choose-editor', function () {
- var url = '<?= \yii\helpers\Url::to(['create']) ?>';
- var type = $(this).val();
- url = url.addQueryParams({editor: type});
- location.href = url;
- })
- </script>
- <?php $this->endBlock() ?>
|