search
HomeCMS TutorialPHPCMSWhich editor is used for PHPCMS?

Which editor is used for PHPCMS?

Jun 19, 2020 pm 05:34 PM
cmsphpcms

Which editor is used for PHPCMS?

# Which editor does PHPCMS use?

PHPCMS uses the CKEditor editor. CKEditor is a new generation of FCKeditor, a re-developed version. This editor is one of the best online web text editors in the world because of its amazing Its performance and scalability make it widely used in major websites.

Integrate CKEditor

There are several ways to integrate CKEditor into your web page. Here we introduce the most commonly used implementations method.

Step One: 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:

<head>
...
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
</head>

Load in the above way, the CKEditor JavaScript API is ready and can be used. .

Step 2: Create an editor instance

CKEditor works like a text area (textarea) in your web page. It provides a simple and easy-to-write user interface and layout. and rich text input areas. But it is not easy to achieve the same effect with a text area. It requires the user to enter html code.

However, in fact, CKEditor still uses a text area to transfer its data to the server. This text area is invisible to the user. Therefore, you must create and edit an instance. First create an instance:

<textarea id="editor1"></textarea>

Note that if you want to load some data into the editor, such as reading data from a database, you only need to put the data in Just inside a textarea, like in the example above. In this example, we have named the textarea "editor1". This name will be used in server operations when receiving POST submitted data. To start using the CKEditor Javascript API, we use an editor instance to "replace" this ordinary text area (textarea). To do this, we must add the following JavaScript code:

<script type="text/javascript">
CKEDITOR.replace( &#39;editor1&#39; );
</script>

The above script block only Can be included after the

<script type="text/javascript">
window.onload = function()
{
CKEDITOR.replace( &#39;editor1&#39; );
};
</script>

Step 3: Save editor content data

As previously described, the editor works like a text area (textarea), so when submitting an editor instance that contains When forming a form, its data will also be passed very simply, using the name of the textarea as the key to receive the data. For example, according to the above example, in PHP we need to process data like this:

<?php
$editor_data = $_POST[ &#39;editor1&#39; ];
?>

Client-side data processing In some applications (such as ajax applications), all data needs to be processed on the client side. It then has its own way of sending the data to the server, in these cases using the CKEditor API is enough to easily get the content in the editor instance. For example:

<script type="text/javascript">
var editor_data = CKEDITOR.instances.editor1.getData();
</script>

Recommended tutorial: "PHPCMS Tutorial"

The above is the detailed content of Which editor is used for PHPCMS?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment