Baidu editor ueditor usage summary-ueditor integration example based on Yii Framework
Preview the Custom Edition page:
Address: http://ueditor.baidu.com/website/index.html
Ueditor is developed by Baidu. the legendary Baidu knows Chinese better, unlike KindEditor, which sometimes displays garbled characters. Ueditor provides download of the Chinese "UTF-8" and "gbk" versions. It can also be divided into the full version and customized version. There is nothing to say about the full version. let's talk about making a plate:
Customized edition allows you to select the desired features and then generate a download package based on the selected components. Address (http://ueditor.baidu.com/website/ipanel/panel.html ). Custom content includes components, editor background colors or images, editor height and width;
It is worth mentioning that Ueditor provides the function instructions and instructions for use. Developers can quickly understand the functions they can implement, save time to read the original JS code, and skillfully use Ueditor. Link to the document (http://ueditor.baidu.com/website/document.html), with instructions for use (from the Ueditor official website ):
Frontend and backend data interaction
1. rich text content interaction
1,Initialize the editor content (that is, set rich text to the editor)
Scenario 1: Write new articles and preset prompts and greetings in the editor.
Find the initialContent parameter in the editor_config.js file and set the value to a required prompt or greeting. for example, initialContent: 'Welcome to UEditor! '.
Scenario 2: edit the old article and extract rich text from the database and place it in the editor.
Obviously, when editing an article, you need to extract a large segment of rich text from the background database. if you still use the method in scenario 1 to set the initial value, it will inevitably lead to problems such as quotation mark matching being truncated, therefore, you need to set it in another way, as shown in the following code: