CnV
CnV

Reputation: 391

Yii booster CKeditor widget replace the 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?

Upvotes: 0

Views: 218

Answers (2)

CnV
CnV

Reputation: 391

Solution for this post:

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

Upvotes: 0

Ashok Chandrapal
Ashok Chandrapal

Reputation: 1020

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!

Upvotes: 1

Related Questions