Smarty Call FCKeditor method, smartyfckeditor_php tutorial

Source: Internet
Author: User

The method of calling FCKeditor in Smarty, Smartyfckeditor


In this paper, we describe the method of calling FCKeditor in Smarty, and share it for your reference. The implementation method is as follows:

FCKeditor is currently the best online editor on the Internet.

Smarty is a php template used to write a template engine, it provides a separation of logic and external content, in brief, the purpose is to use a PHP programmer with the Art of separation, the use of programmers to change the logic of the program content does not affect the design of the art page, The artist re-modifying the page does not affect program logic, which is especially important in a multi-person collaborative project.

To invoke the FCKeditor file in Smarty:

Copy the Code code 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 ');

However, the use of this method in the editing of data when the FCKeditor can not pass the value, just generated a null value of the editor, so only a different method:

Copy the Code code 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 a 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 the Code code as follows:

Example of Smarty use FCKeditor



Example


title:<{$Title}>



Content


<{$FCKeditor}>



I hope this article is helpful to everyone's PHP programming.


How PHP uses FCKeditor in Smarty templates

It is recommended to use Editorphp,fckeditor I started with this, but some server space does not support MSXML. I've had this problem before. So replace the PHP version editorphp developed by Ewebeditor. This kind of configuration is relatively straightforward. Easy to understand. If you want to FCKeditor, you can refer to the following URL.
Reference: hi.baidu.com/...2.html

Smarty template How to reference FCKeditor editor

FCKeditor call method more than PHP output a method
You can use JS mode
or directly with the generated HTML

http://www.bkjia.com/PHPjc/901285.html www.bkjia.com true http://www.bkjia.com/PHPjc/901285.html techarticle Smarty Call FCKeditor method, Smartyfckeditor This article describes the Smarty call FCKeditor method, share to everyone for your reference. The concrete implementation method is as follows: FCKeditor is ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.