Sumith Chalil
Sumith Chalil

Reputation: 358

How to disable html encoding while saving content by using Froala WYSIWYG Editor in Yii2?

I've used Froala editor in my Yii2 application. While saving content to database column question it is added with HTML tags. How can I disable that option, I just want to save the content as it is?

 <?php echo froala\froalaeditor\FroalaEditorWidget::widget([
        'model' => $model,
        'attribute' => 'question',
        'options' => [
            // html attributes
            'id'=>'question'
        ],
        'clientOptions' => [
            'toolbarInline' => false,
            'theme' => 'royal', //optional: dark, red, gray, royal
            'language' => 'en_gb' // optional: ar, bs, cs, da, de, en_ca, en_gb, en_us ...
        ]
    ]); ?>

Upvotes: 0

Views: 1861

Answers (1)

rob006
rob006

Reputation: 22174

Try this:

<?php echo froala\froalaeditor\FroalaEditorWidget::widget([
    'model' => $model,
    'attribute' => 'question',
    'options' => [
        // html attributes
        'id'=>'question'
    ],
    'clientOptions' => [
        'toolbarInline' => false,
        'theme' => 'royal', //optional: dark, red, gray, royal
        'language' => 'en_gb',
        'entities' => '', // <- this
    ]
]); ?>

https://www.froala.com/wysiwyg-editor/docs/options#entities

Upvotes: 1

Related Questions