FCK的一个问题

1.$oFCKeditor->BasePath = ‘/My_ECshop/lib/fckeditor/’ ;我的网站根目录是My_ECshop的。千万不要再出错了!一份喜悦我的收获:我在我的项目中利用了Smarty + FCK 来做后台发布新闻的程序。目前我的做法就是:前端链接到中央控制器处理—-加载FCK并将值赋给FCK的某些变量去—渲染Smarty模型!具体的可以参考这些个内容 我是转载的<?$BasePath = "../include/FCKeditor/";include($BasePath."fckeditor.php");$fck = new FCKeditor('p_info') ;//建立对像$fck->BasePath= $BasePath ;//Fckeditor所在的位置$fck->ToolbarSet= 'News' ;//News为自定义的Fckeditor工具栏名称$fck->Width= '700' ;//长度$fck->Height= '350' ;//高度$fck->Config['AutoDetectLanguage'] = false ;//语言自动检测$fck->Config['DefaultLanguage']= 'zh-cn' ;//语言$content = $fck->CreateHtml();//创建Fckeditor脚本文件$smarty->assign('content',$content);$smarty->display("fck.tpl");?>在smarty的文件中需要显示的地方<tr align="left"><td colspan="2" valign="top" bgcolor="#F5F5F5" class="font12en"><{$content}> </td></tr>提取Fckeditor时,采用如下PHP用$_POST['p_info']得到FCKeditor的值补充:1.此处basepath的路径一定要和上面include的路径一样.否则会找不到文件)另外,对于这个输入内容的变量,如果要把它存入数据库,它的变量名为你建立对象的名字.例如上面就是"p_info"我的代码如下:我的控制器中的一个方法的代码function showAction(){ $title = "hello"; $contents = "zooo"; $oFCKeditor = new FCKeditor(‘content’) ; $oFCKeditor->BasePath = ‘/My_ECshop/lib/fckeditor/’ ; $oFCKeditor->Value = $contents ; $oFCKeditor->Config[‘DefaultLanguage’] = ‘zh_cn’; $content = $oFCKeditor->CreateHtml(); //创建Fckeditor脚本文件 $this->smary->assign(‘title’,$title); //$array = $this->model->show_info($uid); $this->smary->assign(‘content’,$content); $this->smary->display("a.tpl"); }加载配置完了FCK的相关功能。请看 BasePath非常重要!我配置了近一个下午的。要写全目录 即将根目录也要写到位的!然后的话如果要想在Smarty中引入FCK的话要这样来写的:$content = $oFCKeditor->CreateHtml(); //创建Fckeditor脚本文件 $this->smary->assign(‘title’,$title); //$array = $this->model->show_info($uid); $this->smary->assign(‘content’,$content); 而不是说你在Smarty中临时去配置。好了。后台的东西我是走Smarty的。现在开始要考虑下如何当用户POST数据的时候生成静态页面了!这个方法我将在下一节中整理出来!每个人在他的人生发轫之初,总有一段时光,

FCK的一个问题

相关文章:

你感兴趣的文章:

标签云: