dongyuan8024 2016-10-10 11:02
浏览 45

Yii booster CKeditor小部件替换了enterMode

I need help here. I have a system developed with Yii framework. I have the CKEDITOR widget in Yii Booster. When user press the enter key, I want to have 'br'instead of 'p'.

Below is my script:

$this->widget('booster.widgets.TbCKEditor',array(
    'model'=>$model,           
    'attribute'=>'qualifications', 
    'editorOptions'=>array(
                    'enterMode'=> 'CKEDITOR.ENTER_BR',
                    ),
) ); 

However, when I run the script, it still gives me p instead of br. I have been looking for the solution for few days. Can anyone help me with this?

  • 写回答

2条回答 默认 最新

  • donglang1976 2016-10-10 11:08
    关注

    you can have solution from here https://github.com/2amigos/yii2-ckeditor-widget/issues/41

    you need to use clientOptions like below:

    $form->field($model, 'text')->widget(CKEditor::className(), [
            'options' => ['rows' => 6],
            'preset' => 'standard',
            'clientOptions'=>[
                'enterMode' => 2,
                'forceEnterMode'=>false,
                'shiftEnterMode'=>1
            ]
        ])
    

    Hope this will help!

    评论

报告相同问题?

悬赏问题

  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64
  • ¥15 iOS 自定义输入法-第三方输入法
  • ¥15 很想要一个很好的答案或提示
  • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr
  • ¥15 怀疑手机被监控,请问怎么解决和防止
  • ¥15 Qt下使用tcp获取数据的详细操作
  • ¥15 idea右下角设置编码是灰色的
  • ¥15 全志H618ROM新增分区
  • ¥15 在grasshopper里DrawViewportWires更改预览后,禁用电池仍然显示