填充FCK编辑器YII扩展内的值

时间:2012-04-21 07:58:28

标签: php frameworks yii

我想在编辑器中填充值。 通常我们使用$oFCKeditor->Value来显示内容。

对于Yii fck extention,参数是什么?

 $this->widget('application.extensions.fckeditor.FCKEditorWidget',array(
"model"=>$model,                # Data-Model
"attribute"=>'content',         # Attribute in the Data-Model
"height"=>'400px',
"width"=>'100%',

"fckeditor"=>Yii::app()->basePath."/../fckeditor/fckeditor.php",
                                # Path to fckeditor.php
"fckBasePath"=>Yii::app()->baseUrl."/fckeditor/",
                                # Relative Path to the Editor (from Web-Root)
"config" => array("EditorAreaCSS"=>Yii::app()->baseUrl.'/css/index.css',),

在编辑器中显示值的参数是什么?

1 个答案:

答案 0 :(得分:1)

model

中检索FCKeditor中设置的值
"model"=>$model,                # Data-Model
"attribute"=>'content',         # Attribute in the Data-Model

这会将FCKEditor值设置为$model->content

如果您需要设置预定义值,您可以在显示小部件之前执行此操作:

$model->content = 'Some text goes here';