In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "the method of integrating Baidu Ueditor1.4.3 with PHP". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "the method of integrating Baidu Ueditor1.4.3 with PHP".
Recently, many friends have come to ask me how to integrate Baidu UE (ueditor 1.4.3), but I really can't answer it, so write the idea of integrating Baidu UE here, the latest version of UE1.4.3 used in this article.
Download and install
1. First, go to the official website to download the latest version of UE1.4.3.
Official download address of UE: http://ueditor.baidu.com/website/download.html#ueditor
I downloaded the 1.4.3PHP version here. Just download the version you are using.
Extract the file to your project
two。 Deploy. Import the JS file required for UE in the front-end Html page, and then instantiate it using getEditor
The copy code is as follows:
Write your initialization here.
Var ue = UE.getEditor ('container')
Browse your page and you will see Ueditor. Is it very simple to say.
Configure Ueditor
Configuration items for UEditor fall into two categories: front-end configuration items and back-end configuration items.
The configuration of the front and back end is written in the backend (the PHP version of config is in php/config.json). When the editor is instantiated, the configuration information of the back end is asynchronously read and overwritten into the configuration of the front end.
Configuration items obtained by backend > instantiation of incoming configuration items > configuration items of ueditor.config.js file
Front-end configuration item: officially provides two configuration methods, static configuration and dynamic configuration.
Static configuration: that is, to configure the specific configuration items of ueditor.config.js under the ueditor directory, please refer to http://fex-team.github.io/ueditor/#start-config
Dynamic configuration: when the UE is instantiated, the configuration parameters are passed in dynamically.
The copy code is as follows:
Var ue = UE.getEditor ('container', {
/ / write your custom configuration items here
Toolbars: [
['fullscreen',' source', 'undo',' redo', 'bold']
]
AutoHeightEnabled: true
AutoFloatEnabled: true
});
Backend configuration items:
First of all, let's talk about the request of UE: all the operations of UE request serverUrl to pass the value of the action variable through get to proceed to the next step. Get configuration, upload pictures, get pictures, and other operations.
By default, UE acquires the backend configuration items by reading the serverUrl parameter in the ueditor.config.js in the directory and passing action=config through the get method. The default request is: serverUrl?action=config to get the configuration item. ServerUrl can be dynamically configured on the front-end page and ueditor.config.js can be configured statically.
You can test whether the path ueditor/php/controller.php?action=config under your website has returned the backend configuration content in json format (other formats can also be found in the official documentation). The format is roughly as follows. If there is an error in this request, 400, 500 and other errors occur, the editor upload related functions will not work properly.
The copy code is as follows:
{
"imageUrl": "http://localhost/ueditor/php/controller.php?action=uploadimage","
"imagePath": "/ ueditor/php/"
"imageFieldName": "upfile"
"imageMaxSize": 2048
"imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"]
"other configuration items.": "other configuration values."
}
Integration
As mentioned earlier, all operations of UE request serverUrl to pass the value of the action variable through the get method for the next operation. Get configuration, upload pictures, get pictures, and other operations. Knowing this, for integrating PHP. Or any other language is very simple.
At this point, I believe that everyone on the "PHP integration of Baidu Ueditor1.4.3 method" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.