Domanda

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

È stato utile?

Soluzione

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!

Altri suggerimenti

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'
            )
        )
    )
)); ?>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top