Question

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

Was it helpful?

Solution

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!

OTHER TIPS

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'
            )
        )
    )
)); ?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top