create_html_editor()函數在includes文件夾下lib_main.php文件中:
(更多的信息可以去我的私人博客:沒有船的海賊 www.hanluner.com)
- /**
- * 生成編輯器
- * @param string input_name 輸入框名稱
- * @param string input_value 輸入框值
- */
- function create_html_editor($input_name, $input_value = '')
- {
- global $smarty;
- $editor = new FCKeditor($input_name);
- $editor->BasePath = '../includes/fckeditor/';
- $editor->ToolbarSet = 'Normal';
- $editor->Width = '100%';
- $editor->Height = '320';
- $editor->Value = $input_value;
- $FCKeditor = $editor->CreateHtml();
- $smarty->assign('FCKeditor', $FCKeditor);
- }
goods.php文件中範例:
- include_once(ROOT_PATH . 'includes/fckeditor/fckeditor.php'); // 包含 html editor 類文件
/* 創建 html editor */
create_html_editor('goods_desc', $goods['goods_desc']);
目標文件中添加:
{$FCKeditor}