Php 如何在Yii中设置FCK编辑器?

Php 如何在Yii中设置FCK编辑器?,php,yii,fckeditor,Php,Yii,Fckeditor,我是Yii框架的新手, 我需要为我的CMS管理页面FCK编辑器。我下载了FCKeditor并将其解压缩到根文件夹及其yii extension文件夹中的扩展名。我在视图中添加了以下代码 <?php $this->widget('application.extensions.fckeditor.FCKEditorWidget',array( "model"=>$model, # Data-Model "attribute"=>'

我是Yii框架的新手, 我需要为我的CMS管理页面FCK编辑器。我下载了FCKeditor并将其解压缩到根文件夹及其yii extension文件夹中的扩展名。我在视图中添加了以下代码

<?php $this->widget('application.extensions.fckeditor.FCKEditorWidget',array(
    "model"=>$model,                # Data-Model
    "attribute"=>'content',         # Attribute in the Data-Model
    "height"=>'400px',
    "width"=>'100%',
    "toolbarSet"=>'Basic',          # EXISTING(!) Toolbar (see: fckeditor.js)
    "fckeditor"=>Yii::app()->basePath."/../fckeditor/fckeditor.php",
                                    # Path to fckeditor.php
    "fckBasePath"=>Yii::app()->baseUrl."/fckeditor/",
                                    # Realtive Path to the Editor (from Web-Root)
    "config" => array(
        "EditorAreaCSS"=>Yii::app()->baseUrl.'/css/index.css',),
                                    # http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options
                                    # Additional Parameter (Can't configure a Toolbar dynamicly)
    ) ); ?>

要使用FCKEditor而不是上述文本区域,请通过将上述代码替换为以下代码来调用集成小部件

<?php $this->widget('application.extensions.fckeditor.FCKEditorWidget',array(
 'model'     =>  $model,
 'attribute' => 'content',
 'height'    =>  '600px',
 'width'     =>  '100%',
 'fckeditor' =>  dirname(Yii::app()->basePath).'/htdocs/fckeditor/fckeditor.php',
 'fckBasePath' => Yii::app()->baseUrl.'/fckeditor/')
 ); ?>


你是否做过类似的事情,如果你这样做了,那么文本区域将被编辑器取代,希望这有帮助

每次我看到FCK编辑器,我想它会说一些其他的东西…是的,这很有效。。。谢谢Sudhir。Me遵循了jquery模型的替换,这就是重复。。谢谢
<?php $this->widget('application.extensions.fckeditor.FCKEditorWidget',array(
 'model'     =>  $model,
 'attribute' => 'content',
 'height'    =>  '600px',
 'width'     =>  '100%',
 'fckeditor' =>  dirname(Yii::app()->basePath).'/htdocs/fckeditor/fckeditor.php',
 'fckBasePath' => Yii::app()->baseUrl.'/fckeditor/')
 ); ?>