YiiBooster Redactor编辑器选项

时间:2013-06-10 02:44:53

标签: yii-extensions redactor

我一直在研究使用YiiBooster小部件在Redactor中指定编辑器选项的正确方法。我正在使用以下代码:

<?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
'id' => 'item-form',
'enableAjaxValidation' => false,
'enableClientValidation'=>true, 
'clientOptions'=>array(
    'validateOnSubmit'=>true,
    ),

));

 <?php echo $form->redactorRow($model, 'description', array(
  'buttons' =>    
  'formatting', '|', 'bold', 'italic', 'deleted', '|', 'alignment', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent'
  )); ?>

但它似乎仍然返回默认设置。任何人都可以指出我正确的方向。

由于

强尼

2 个答案:

答案 0 :(得分:1)

找到答案!

      <?php echo $form->redactorRow($model, 'description', array(
'options' => array(
'minHeight' => 200,
'buttons' => array(
    'formatting', '|', 'bold', 'italic', 'deleted', '|', 'alignment', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent')
)
)); 

希望对某人有所帮助!

答案 1 :(得分:0)

对于yiibooster 4.x.x:

<?php echo $form->redactorGroup($model, 'content', array(
    'widgetOptions' => array(
        'editorOptions' => array(
            'minHeight' => 200,
            'buttons' => array(
                'formatting', '|', 'bold', 'italic', 'deleted', '|', 'alignment', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent'
            )
        )
    )
)); ?>