【问题标题】:populate the value inside the FCK editor YII extension在 FCK 编辑器 YII 扩展中填充值
【发布时间】:2012-04-21 07:58:27
【问题描述】:

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

对于 Yii fck 扩展的参数是什么?

 $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',),

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

【问题讨论】:

    标签: php frameworks yii


    【解决方案1】:

    在FCKeditor中设置的值是从model中检索的:

    "model"=>$model,                # Data-Model
    "attribute"=>'content',         # Attribute in the Data-Model
    

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

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

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

    【讨论】:

    猜你喜欢
    • 2011-10-05
    • 1970-01-01
    • 2013-12-17
    • 2019-06-09
    • 2011-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多