YiiBooster - 自定义ckeditorrow

时间:2013-06-15 05:54:01

标签: php yii yii-extensions yii-components

早安伙伴们!

我有一个问题需要解决。我在网上尝试了所有可能性,但没有任何效果。

使用YiiBooster,问题是使用ckEditorRow。当我尝试使用这个小部件来显示一些选项时,根据CkEditor的手册,我可以更改属性'toolbar',但我尝试以多种方式配置但不起作用!

我的最后一次测试是:

$ckeditor = "[
        { name: 'document', items : [ 'NewPage','Preview' ] },
        { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
        { name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','Scayt' ] },
        { name: 'insert', items : [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'
                 ,'Iframe' ] },
                '/',
        { name: 'styles', items : [ 'Styles','Format' ] },
        { name: 'basicstyles', items : [ 'Bold','Italic','Strike','-','RemoveFormat' ] },
        { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote' ] },
        { name: 'links', items : [ 'Link','Unlink','Anchor' ] },
        { name: 'tools', items : [ 'Maximize','-','About' ] }
    ];";

<?php echo $form->ckEditorRow($model, 'ds_nick_usr', array('options'=>array('language'=>'pt','disableNativeSpellChecker'=>false,'scayt_autoStartup'=>true, 'toolbar_Basic'=>$ckeditor, 'toolbar'=>'Basic', 'fullpage'=>'js:true', 'width'=>'640', 'resize_maxWidth'=>'640','resize_minWidth'=>'320')));?>

在这个测试中,我的ckEditorRow应该只显示选项,Source,Bold和Italic。但在这种情况下,没有任何显示!

其他测试显示完整的编辑。

任何解决我问题的想法?

提前致谢!

PS:我也尝试编辑config.js但没有成功;

最诚挚的问候, 马科斯。

2 个答案:

答案 0 :(得分:1)

Yii将逃避您的JS代码,因此所有'将成为\'。

您需要做的就是:$ ckeditor =“js:[您拥有的配置]”

答案 1 :(得分:0)

只是一个答案,也许它可能有助于某人:

    <?php echo $form->ckEditorGroup($model,'ds_nick_usr',
    array(
    'widgetOptions' => array(
        'editorOptions' => array(
            'toolbar'=>array(
                array( '-', 'Bold', 'Italic', 'Strike' ),
                array( 'Image', 'Link', 'Unlink', '-', 'Source'),
            ),
        ),
    ))); ?>             

适合我。

相关问题