Y!i 2011-05-24 11:19:19 6643次浏览 20条回复 0 0 0

注意:本教程使用的FCKeditor版本是:2.6.6,点击http://sourceforge.net/project/downloading.php?group_id=75348&filename=FCKeditor_2.6.6.zip

需求:

Yii 1.0 或更新的版本 FCKEditor FCKEditor integration widget:这里使用的版本是 0.0.4,点击http://www.yiiframework.com/extension/fckeditor-integration/files/fckeditor-integration-0.0.4.zip。 安装:

解压fckeditor-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'
)
); 
?>
您需要登录后才可以回复。登录 | 立即注册