ThinkPHP3.0 uses the correct configuration method of Baidu ueditor.

Source: Internet
Author: User
ThinkPHP3.0 correct configuration method for using Baidu ueditor... When using Baidu ueditor and configuring according to articles on Baidu, the editor may encounter problems that cannot be used by controls. by following my methods, the editor can be fully enabled. Configure the file upload path ...... Step 1: Download ueditor and put it in the Public folder .? Step 2: Configure ueditor? The editor_config.js file ?? ThinkPHP3.0 correct configuration method for using Baidu ueditor...

When using Baidu ueditor and configuring according to articles on Baidu, the editor may encounter problems that cannot be used by controls. by following my methods, the editor can be fully enabled.

Configure the file upload path ......

Step 1: Download ueditor and put it in the Public folder.

?

Step 2: Configure ueditor? Editor_config.js file

?

?

URL = window. UEDITOR_HOME_URL | tmp. substr (0, tmp. lastIndexOf ("\/") + 1 ). replace ("_ examples /",""). replace ("website/", ""); // you can configure the relative or absolute path of the ueditor directory on your website (the absolute path starting with http) // change to relative path... URL = window. UEDITOR_HOME_URL | "/Public/ueditor /";
?


Step 3: Reference ueditor and write the following code in the template file you want to use ueditor:

?

 
 
 The default import method of ThinkPHP is directly under the Public Directory. do not write the suffix


Step 4: set the rules for storing Model. class. php files:

?

?

Array ('text', 'htmldecode', 3, 'callback'), // The automatic completion rule of the ThinkPHP3 text field // text escape function htmldecode () {if (! Empty ($ _ POST ['text']) {$ contents = htmlspecialchars (stripslashes ($ _ POST ['text']); return $ contents ;}}
?

Step 5: HTML page application and data extraction

?

?

{$ List. text | htmlspecialchars_decode}
 
 

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.