Good day!
I have form created with GII.
<div class="articles-form">
<?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>
<?= $form->field($model, 'title')->textInput(['maxlength' => 512]) ?>
<?= $form->field($model, 'preview_text')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'full_text')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'date_created')->textInput() ?>
<?= $form->field($model, 'date_modified')->textInput() ?>
<?= $form->field($model, 'sort')->textInput() ?>
<?= $form->field($model, 'keywords')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'description')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'file')->fileInput() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("articles-full_text"), {
lineNumbers: true,
lineWrapping: true,
matchBrackets: true,
mode: "application/x-httpd-php",
indentUnit: 2,
indentWithTabs: true,
tabMode: "indent"
});
</script>
</div>
As you can see, I have textarea with id "articles-full_text", that contains html tags. For example, I need to record this full-text:
<span style="font-weight: bold; color: #a23;">Hello</span>
but when I open page, that contains data from article, page source shows me this:
<span style="font-weight: bold; color: #a23;">Hello</span>
I am not sure, but I think, database contains right variant. I have tried to find information about filters in Yii2, but useless.
Can someone explain, how can I disable html tags filter in this textarea? Thanks.