| Current Path : /var/www/html/dynawebv3.blunetdev.com/backend/modules/api/views/api/ |
| Current File : /var/www/html/dynawebv3.blunetdev.com/backend/modules/api/views/api/_form.php |
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\assets\AceEditorAsset;
/* @var $this yii\web\View */
/* @var $model backend\modules\api\models\Api */
/* @var $form yii\widgets\ActiveForm */
AceEditorAsset::register($this);
$this->registerJs(
<<<JS
var textarea = $('#api-api_content').hide();
var editor = ace.edit('editorContent');
editor.setOptions({
maxLines: Infinity,
});
editor.setTheme("ace/theme/monokai");
//editor.\$blockScrolling = Infinity;
editor.getSession().setMode("ace/mode/php");
editor.getSession().setValue(textarea.val());
editor.getSession().on('change', function () {
textarea.val(editor.getSession().getValue());
});
JS
);
?>
<style type="text/css" media="screen">
.ace_editor{ min-height:300px;z-index:9999;}
.ace_text-input{position:absolute!important}
#editorContent{margin-bottom:2em;}
.field-api-api_content{margin:0 !important;}
.field-api-api_content .help-block{margin:0 !important;}
</style>
<div class="wrapper wrapper-content animated fadeInRight" style="padding: 20px 10px 0px;">
<div class="ibox float-e-margins">
<div class="ibox-content">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'api_code')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'api_descr')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'api_content')->textarea(['rows' => 6]) ?>
<div id="editorContent"></div>
<div class="form-group"><?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?></div>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>