Home > Backend Development > PHP Tutorial > How to call FCKeditor in Smarty, smartyfckeditor_PHP tutorial

How to call FCKeditor in Smarty, smartyfckeditor_PHP tutorial

WBOY
Release: 2016-07-13 10:15:49
Original
895 people have browsed it

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}>



I hope this article will be helpful to everyone’s PHP programming design.

php How to use fckeditor in smarty template

It is recommended to use EditorPHP. I also used fckeditor when I first started, but some server spaces do not support msxml. I've encountered this problem before. So I changed to EditorPHP, the PHP version developed by ewebeditor. This configuration is relatively simple. Easy to understand. If you insist on fckeditor, you can refer to the following URL.
Reference: hi.baidu.com/...2.html

How to reference fckeditor editor in smarty template

The fckeditor calling method is more than just PHP output method
You can use js method
or directly use the generated html

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/901285.htmlTechArticleThe method of calling FCKeditor in Smarty, smartyfckeditor This article describes the method of calling FCKeditor in Smarty and shares it with everyone. refer to. The specific implementation method is as follows: FCKeditor is...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template