文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>在Smarty中使用FCKeditor

在Smarty中使用FCKeditor

时间:2007-02-11  来源:lib


?php
require_once('./FCKeditor/fckeditor.php');
require_once('./Smarty/Smarty.class.php'); //载入Smarty
$smarty = new Smarty();
/* Smarty配置 */
$smarty->template_dir = "./templates/default";
$smarty->compile_dir = "./templates/compiled"; //
$smarty->config_dir = "./templates/configs"; //
$smarty->cache_dir = "./caches";
$smarty->left_delimiter = '{';
$smarty->right_delimiter = '/}';
createEditor('FCKeditor1');
$smarty->display('editor.htm');
/**
* 生成编辑器
* @param string inputName 输入框名称
* @param string inputValue 输入框值
* @param string height 高
* @param string toolbarSet 工具条设置
*/
function createEditor($inputName, $inputValue = '',$height='320',$toolbarSet='Default'){
    $editor = new FCKeditor($inputName) ;
    $editor->BasePath = "../libs/editor/";
    $editor->ToolbarSet = "Default";
    $editor->Width = "100%";
    $editor->Height = $height;
    $editor->Value = $inputValue;
    $GLOBALS['smarty']->assign("editor", $editor->CreateHtml());
}
?>
editor.htm的内容:
{$editor/}


相关阅读 更多 +
排行榜 更多 +
PvZ戴夫的时空冒险重置

PvZ戴夫的时空冒险重置

策略塔防 下载
PVZTV雪版阳光加50

PVZTV雪版阳光加50

策略塔防 下载
双刃战士雪姐

双刃战士雪姐

冒险解谜 下载