0

我一直在研究使用 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'
  )); ?>

但它似乎仍然返回默认设置。谁能指出我正确的方向。

谢谢

强尼

4

2 回答 2

1

找到了答案!

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

希望这对某人有帮助!

于 2013-06-10T20:19:41.390 回答
0

对于 yiibooster 4.xx:

<?php echo $form->redactorGroup($model, 'content', array(
    'widgetOptions' => array(
        'editorOptions' => array(
            'minHeight' => 200,
            'buttons' => array(
                'formatting', '|', 'bold', 'italic', 'deleted', '|', 'alignment', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent'
            )
        )
    )
)); ?>
于 2015-07-11T01:27:33.600 回答