北京过客 2011-05-29 10:06:57 3424次浏览 2条回复 0 0 0

需求: Yii 1.0 或更新的版本 FCKEditor FCKEditor integration widget:这里使用的版本是 0.0.4,点击下 载。 安装: 解压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'
)
); 
?>
您需要登录后才可以回复。登录 | 立即注册