Answer the question
In order to leave comments, you need to log in
TinyMCE in Yii2 - html tags are displayed after text formatting. How to fix?
Connected the TinyMCE widget to the form
<?= $form->field($model, 'content')->widget(TinyMce::className(), [
'options' => ['rows' => 12],
'language' => 'ru',
'clientOptions' => [
'plugins' => [
'advlist autolink lists link charmap print hr preview pagebreak',
'searchreplace wordcount textcolor visualblocks visualchars code fullscreen nonbreaking',
'save insertdatetime media table contextmenu template paste image'
],
'toolbar' => 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image'
]
]) ?>
<p><em><strong>Хорошие</strong></em></p>
Answer the question
In order to leave comments, you need to log in
This is called data formatting.
For flexible HTML formatting on the page or when saving, the Yii team implemented a special HTML Purifier helper. . It has a lot of different settings. You can see how to use Yii 1.0 as an example . Or read the official documentation .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question