Frage

I've been looking at what the correct way is to specify the editor options within Redactor using the YiiBooster widget. I'm using the following code:

<?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'
  )); ?>

But it still seems to return the default settings. Would anyone be able to point me in the right direction please.

Thanks

Jonny

War es hilfreich?

Lösung

Found out the answer!

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

Hope that is of help to someone!

Andere Tipps

For 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'
            )
        )
    )
)); ?>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top