我在Yii2应用程序中使用了Froala编辑器。在将内容保存到数据库列问题时,它会添加HTML标记。如何禁用该选项,我只想保存原样?
<?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 ...
]
]); ?>
答案 0 :(得分:0)
试试这个:
<?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
]
]); ?>