You can insert the editor using this way:
- Code: Select all
<?php
$this->widget('application.modules.lang.components.langFieldWidget', array(
'model' => $model,
'field' => 'название_поля_в_таблице',
'type' => 'text-editor'
));
?>
Let's take a look for example at the "Description" field and the process of creating/editing a listing. We had the following code In the file protected\modules\apartments\views\backend\__form_general.php:
- Code: Select all
<?php
$this->widget('application.modules.lang.components.langFieldWidget', array(
'model' => $model,
'field' => 'description',
'type' => 'text'
));
?>
and it should be WYSIWYG editor:
- Code: Select all
<?php
$this->widget('application.modules.lang.components.langFieldWidget', array(
'model' => $model,
'field' => 'description',
'type' => 'text-editor'
));
?>
Remove the CHtml::encode in the file protected\modules\apartments\views\_tab_general.php for description field during the output