Smarty中调用FCKeditor的方法,smartyfckeditor_PHP教程
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Smarty中调用FCKeditor的方法,smartyfckeditor_PHP教程,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1832字,纯文字阅读大概需要3分钟。
内容图文
![Smarty中调用FCKeditor的方法,smartyfckeditor_PHP教程](/upload/InfoBanner/zyjiaocheng/185/76e96603bb4e496ba33a6cf34acbdab1.jpg)
Smarty中调用FCKeditor的方法,smartyfckeditor
本文实例讲述了Smarty中调用FCKeditor的方法,分享给大家供大家参考。具体实现方法如下:
FCKeditor是目前互联网上最好的在线编辑器。
smarty是一个使用PHP写出来的模板PHP模板引擎,它提供了逻辑与外在内容的分离,简单的讲,目的就是要使用PHP程序员同美工分离,使用的程序 员改变程序的逻辑内容不会影响到美工的页面设计,美工重新修改页面不会影响到程序的程序逻辑,这在多人合作的项目中显的尤为重要。
在Smarty中调用FCKeditor的文件:
代码如下:require_once("conn.php");
require_once("class/Smarty.class.php");
$smarty = new Smarty();
$smarty->template_dir = "../templates";
$smarty->compile_dir = "../templates_c";
$smarty->left_delimiter = "<{";
$smarty->right_delimiter = "}>";
$editor = new FCKeditor("Content") ;
$editor->BasePath = "../FCKeditor/";
$editor->ToolbarSet = "Basic";
$editor->Value = "";
$FCKeditor = $editor->CreateHtml();
$smarty->assign('Title',"Rossy is here waiting for you");
$smarty->assign('FCKeditor',$FCKeditor);
$smarty->display('template.tpl');
但是运用这一种方法在编辑资料的时候竟然FCKeditor传不了值,只是生成了一个空值的编辑器,所以只能换一种方法:
代码如下:require_once("conn.php");
require_once("class/Smarty.class.php");
$smarty = new Smarty();
$smarty->template_dir = "../templates";
$smarty->compile_dir = "../templates_c";
$smarty->left_delimiter = "<{";
$smarty->right_delimiter = "}>";
$editor = new FCKeditor("Content") ;
$editor->BasePath = "../FCKeditor/";
$editor->ToolbarSet = "Basic";
$editor->Value = "Here is a example of smarty and FCKeditor";
$smarty->assign('Title',"Rossy is here waiting for you");
$smartyl->assign_by_ref("FCKeditor",$editor);
$smarty->display('template.tpl');
模板文件template.tpl:
代码如下: Example title:<{$Title}> content: <{$FCKeditor}>
内容总结
以上是互联网集市为您收集整理的Smarty中调用FCKeditor的方法,smartyfckeditor_PHP教程全部内容,希望文章能够帮你解决Smarty中调用FCKeditor的方法,smartyfckeditor_PHP教程所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。