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}
转载于:https://blog.51cto.com/hanluner03/456502