The method of calling FCKeditor in Smarty, smartyfckeditor
The example in this article describes the method of calling FCKeditor in Smarty and is shared with everyone for your reference. The specific implementation method is as follows:
FCKeditor is currently the best online editor on the Internet.
smarty is a template PHP template engine written in PHP. It provides the separation of logic and external content. Simply put, the purpose is to separate PHP programmers from artists, and use programmers to change the logic of the program. The content will not affect the artist's page design, and the artist's re-modification of the page will not affect the program logic of the program, which is particularly important in multi-person collaboration projects.
File for calling FCKeditor in Smarty:
Copy code The code is as follows:
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');
But when using this method to edit data, FCKeditor cannot pass the value and only generates an editor with a null value, so we can only use another method:
Copy code The code is as follows:
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 an 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 file template.tpl:
Copy code The code is as follows:
example of smarty use fckeditor
Example
title:<{$Title}>
content:
<{$FCKeditor}>