In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you about what editors PHPCMS has, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Let's take a look at it with the editor.
PHPCMS uses CKEditor editor, CKEditor is a new generation of FCKeditor, is a redeveloped version, this editor is one of the best online text editors for web pages in the world, and is widely used in major websites because of its amazing performance and scalability.
Integrated CKEditor
There are several ways to integrate CKEditor into your web page, and here are the most commonly used implementations.
Step 1: load CKEditor
CKEditor is a JavaScript application, you only need to include a file reference in your web page to load it.
If you have installed CKEditor in the "ckeditor" directory of your website, you can refer to the following example:
...
Load in the above way, and CKEditor JavaScript API is ready to use.
Step 2: create an editor instance
CKEditor works like a textarea in your web page, providing an easy-to-write user interface, layout, and rich text input area. However, it is not easy to achieve the same effect with a text area, which requires the user to enter html code.
However, in practice, CKEditor still uses a text area to pass its data to the server, which is not visible to the user. So, you must create and edit an instance, first creating an instance:
Note that if you want to load some data into the editor, such as reading data from the database, just put the data in the textarea, as in the example above. In this example, we have named the text area (textarea) the "editor1". This name will be used for server operations when data submitted by POST is received. To start using CKEditor Javascript API, we "replace" the normal text area (textarea) with an editor example. To do this, we must add the following JavaScript code:
CKEDITOR.replace ('editor1')
The script block above can only be included after the tag of the web page. You can also run the replacement process within the tag, but in this case, you must make sure that the DOM has been loaded, which can usually be written in the _ window.onload event (at which point the DOM must have been loaded):
_ window.onload = function () {CKEDITOR.replace ('editor1');}
Step 3: save editor content data
According to the previous description, the editor works like a textarea, so when submitting a form containing an editor instance, its data will also be easily passed, receiving the data with the name of the textarea as the health name. For example, according to the above example, in PHP we need to process data like this:
Some client-side data processing applications (such as ajax applications) need to process all the data on the client, and then send the data to the server in its own way. In these cases, using CKEditor API is enough to easily get the content in the editor instance. For example:
Var editor_data = CKEDITOR.instances.editor1.getData ()
These are the editors of PHPCMS, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.