The FCKeditor method is called in Smarty. the smartyfckeditor_PHP tutorial-php Tutorial

Source: Internet
Author: User
Smarty calls the FCKeditor method, smartyfckeditor. Smarty calls the FCKeditor method. smartyfckeditor in this article describes how Smarty calls the FCKeditor method for your reference. The specific implementation method is as follows: FCKeditor is the method that Smarty calls FCKeditor, smartyfckeditor

This article describes how to call FCKeditor in Smarty and shares it with you for your reference. The specific implementation method is as follows:

FCKeditor is currently the best online editor on the Internet.

Smarty is a PHP template engine written using PHP. It provides the separation of logic and external content. In short, it aims to separate PHP programmers from the artist, changing the logic content of a program by a programmer does not affect the page design of the artist. modifying the page by the artist does not affect the program logic. This is especially important in projects that involve multiple partners.

Files that call FCKeditor in Smarty:

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 ');

However, FCKeditor cannot pass the value when editing the data. it only generates a null editor. Therefore, you can only use the following method:

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 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. tpl:

The code is as follows:



Example of smarty use fckeditor



Example


Title: <{$ Title}>



Content:


<{$ FCKeditor}>



I hope this article will help you with PHP programming.


How does php use fckeditor in the smarty template?

We recommend that you use EditorPHP, and fckeditor is also used at the beginning, but some server spaces do not support msxml. I have encountered this problem before. Therefore, it is changed to the PHP version EditorPHP developed by ewebeditor. This configuration is relatively simple. Easy to understand. If you need fckeditor, you can refer to the following URL.
Reference: hi.baidu.com/..2.html

How to reference the fckeditor editor in the smarty template?

Fckeditor calls more than php outputs.
You can use js
Or directly use the generated html

Examples in this article describes how to call FCKeditor in Smarty and share it with you for your reference. The specific 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.