ubn5/backend/modules/cms/views/page/_form.php

37 lines
1022 B
PHP

<?php
use dosamigos\ckeditor\CKEditor;
use nickdenry\ckeditorRoxyFileman\RoxyFileManager;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\CmsPage */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="cms-page-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'description')->widget(CKEditor::className(), [
'preset' => 'full',
'clientOptions' => RoxyFileManager::attach([
'extraPlugins' => 'justify,codesnippet,colorbutton,iframe,dialogadvtab,liststyle,smiley,devtools,div',
]),
]) ?>
<?php $this->registerJs("CKEDITOR.config.allowedContent = true;") ?>
<?php $this->registerJs("CKEDITOR.config.removeFormatAttributes = '';") ?>
<div class="form-group">
<?= Html::submitButton('บันทึก', ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>