FCKeditor + smarty
FCKeditor是目前互联网上最好的在线编辑器。
smarty是一个使用PHP写出来的模板PHP模板引擎,它提供了逻辑与外在内容的分离,简单的讲,目的就是要使用PHP程序员同美工分离,使用的程序 员改变程序的逻辑内容不会影响到美工的页面设计,美工重新修改页面不会影响到程序的程序逻辑,这在多人合作的项目中显的尤为重要。<!-- more-->
在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:
<htm>
<head>
<title>example of smarty use fckeditor</title>
</head><body>
<P>Example</p>
<p>title:<{$Title}></p>
<p></p>
<p>content:</p>
<p><{$FCKeditor}></p>
</body>
</html>
FCKeditor + smarty相关推荐
- ECShop替换FCKeditor编辑器为KindEditor
为什么80%的码农都做不了架构师?>>> 理论上可以替换包括百度ueditor在内的其他任何编辑器,步骤包括: 1.上传新编辑器代码 首先下载Kindeditor,解压后将文件 ...
- FCKeditor使用方法技术详解
转载自 http://www.cnblogs.com/cchyao/archive/2010/07/01/1769204.html 1.概述 FCKeditor是目前最优秀的可见即可得网页编辑器之一, ...
- smarty新闻管理系统
经过将近两个星期的学习,我们学习了smarty的模板的应用.相信大家也对smarty模板也有所了解了.如果大家觉得smarty框架还有不懂的地方,可以翻看前一段我给大家讲解的smarty博文,应该那些 ...
- FckEditor中文配置手册详细说明
来源: http://www.phpchina.com/51068/viewspace_22098.html 对FckEditor的一点使用经验,及网络上的资料整理 出处 http://www.lin ...
- 网页编辑器FCKeditor 2.6.4精简配置方法
今天看到网上有人问asp中FCKeditor的配置方法,特整理了一些文档方便需要的朋友 上传目录请在fckeditoreditorfilemanagerconnectorsaspconfig.asp中 ...
- smarty mysql demo_PHP Smarty模版简单使用方法
本文实例讲述了PHP Smarty模版简单使用方法.分享给大家供大家参考,具体如下: Index.php: require('../libs/Smarty.class.php'); $smarty = ...
- php smarty关闭缓存,php+Smarty的缓存操作
一.使用缓存 要开启smarty的缓存,只需将caching设为true,并指定cache_dir即可. 使用cache_lefetime指定缓存生存时间,单位为秒 要对相同页面生成多个不同的缓存,在 ...
- php smarty模板引擎 性能,smarty性能低?直接使用php模板引擎吧
skymvc框架使用的php模板引擎 1.[代码][PHP]代码 class smarty{ public $template_dir = '';//模版文件夹 public $cache_dir = ...
- FCKeditor如何升级CKEditor及使用方法
之前编辑器用的是FCKeditor,因为项目原因需要升级为最新版本4.2.2,发现是已经更名为CKEditor. 百度了一下,据官方的解释,CK是对FCK的代码的完全重写. 项目环境是asp.net的 ...
最新文章
- 搭建git for windows服务器(100%可以成功)【转】
- Linux安装zookeeper并验证
- BZOJ2631: tree
- vuecli3修改html,vue-cli3多页应用改造
- phpStorm中的unescaped xml character问题
- mysql的altertable_mysqlaltertable修改表命令详细介绍
- 数字化工厂的五大系统_如何搭建以MES系统为核心的数字化工厂?
- 【Linux】Linux按tab键补全文件(名)或路径不区分大小写
- php mysql 命令行模式_MySQL_MYSQL导入导出sql文件简析,一.MYSQL的命令行模式的设置- phpStudy...
- 剑指Offer_12_矩阵中的路径(参考问题:马踏棋盘)
- 项目部署到服务器后字符编码,将UTF-8编码的数据发布到服务器会丢失某些字符...
- Atitit. 软件GUI按钮与仪表盘--web服务器区--获取apache配置文件路径 linux and apache的启动、停止、重启
- 什么是PID控制中的超调
- CSS盒模型居中方法,看这篇足矣了!
- python函数之enumerate()快速打印出列表中的元素以及对应的下标
- 年轻人的第一个开发板——树莓派
- Clickhouse其它类型表引擎(Live View、Null、URL)
- 目前有哪些国产的真无线蓝牙耳机比较好?国产真无线蓝牙耳机合集
- vue项目实现摇一摇h5
- Android输入法官方SoftKeyboard示例解析
热门文章
- 信息学奥赛一本通C++语言——1002:输出第二个整数
- 45 FI配置-财务会计-固定资产-一般评估-指定折旧条件转移
- python 自动化办公 uibot_【插件开发】使用 Python 扩展 UiBot 的功能
- 协同进化遗传算法 代码_遗传算法在组卷中的应用
- 洛达检测软件_洛达1562m之体验篇
- 笨方法“学习python笔记之变量及打印
- pytorch1.7教程实验——分类器训练
- Classification Example
- 为什么先编码再解码? 即先降采样,然后上采样
- cmd命令 - vue项目:单独安装vue-router