原文:http://www.yiichina.com/forum/thread-434-1-1.html
注意:本教程使用的FCKeditor版本是:2.6.6,点击下载地址。
需求:
Yii1.0 或更新的版本
FCKEditor
FCKEditor integration widget:这里使用的版本是 0.0.4,点击 下载。
安装:
解压f ckeditor-integration-0.0.4.zip到 protected/extensions。
解压FCKeditor:假设我们的应用的URL是http:// localhost/musicdream/,实际目录是C:\wamp \www\musicdream\,将fckeditor解压至C:\wamp\www\musicdream\,这时可以看到一个目录C:\wamp \www\musicdream\fckeditor,里面就是fckeditor所有的文件。
使用:
在一个视图文件(例如C:\wamp\www\musicdream\protected\ views\artist\_create. php)中:
<?php
$this->widget('application.extensions.fckeditor.FCKEditorWidget',array(
' model' => $model,
'attribute' => 'intro',//属性的名字
'height' => '500px',//高度
'width' => '100%',//宽度
'fckeditor' => Yii::app()->basePath.'/../fckeditor/fckeditor.php',
'fckBasePath' => Yii::app()->baseUrl.'/fckeditor/',
'config' => array('ToolbarStartExpanded'=>false),// 配置,这里设置的是默认不展开工具条
'editorTemplate' => 'full'
)
);
?>