设为首页
加为收藏
联系我们
  • 电子商务
  • 软件网络
  • 看天下
  • 营销财经
  • 关闭导航
  • 网络编程
  • 数据库类
  • 关闭导航
  • 网络编程
  • 社交礼仪
  • 数据库类
  • 人文地理
  • 关闭导航
  • 编程工具
  • 电子书籍
  • 关闭导航
  • 生活休闲
  • 演讲讲座
  • 视频教程
  • 经典影视
  • 关闭导航
  • 您的位置: 首页 > 文章中心 > 网络编程 > PHP

    Smarty与FCKeditor搭配使用

    时间: 2008-09-25  信息来源: CSDN  作者: 编程整理  点击数:

    内容提示:本文将介绍如何实现Smarty与FCKeditor搭配使用.
     
     <?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/}
     
    Tags: Smarty,FCKeditor 责任编辑:aboutstudy
     
      关于我们 友情链接 网站地图 广告服务 联系我们 管理登陆  
      鄂ICP备07014143号  
      Powered by EmpireCMS 5.0  
      Template designed by 直来直往.
      联系信息: QQ 365931563 Email:jiangtian001@sina.com  
      ©CopyRight 2007-2008, SKDE.CN, Inc. All Rights Reserved