如何在PHP页面中添加或嵌入CKEditor [英] how to add or embed CKEditor in php page

查看:105
本文介绍了如何在PHP页面中添加或嵌入CKEditor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在PHP页面中添加或嵌入CKEditor,我将zip文件下载并解压到目录的根目录,并在我的页面上调用

 <?php require(ckeditor / ckeditor.php); > 

赋予textarea此字段

 < textarea class =ckeditorname =editor1>写任何东西< / textarea> 

但它不工作,
PHP上的安装文档CKEditor网站。 / p>

有没有人知道我们或帮助我在这个应用程序。

解决方案

集成ckeditor和php页面的简单步骤



步骤1:下载ckeditor.zip文件



步骤2:将ckeditor.zip文件粘贴到网站的根目录或
您可以粘贴到文件所在的位置(我这样做)



步骤3:提取ckeditor.zip文件



步骤4:打开您要与此处整合的所需php页面page1.php



步骤5:在下面添加一些javascript,这是调用ckeditor和样式的元素和css
没有这个,你将只有一个空白textarea

 < script type =text / javascriptsrc =ckeditor / ckeditor.js>< / script& 

如果您在其他网站使用,那么使用相对链接, p>

 < script type =text / javascriptsrc =somedirectory / ckeditor / ckeditor.js>< / script& 

步骤6:now !,你需要调用ckeditor的工作代码页面page1.php
下面是你如何调用它

 <?php 

//确认你在这里使用正确的路径。
include_once'ckeditor / ckeditor.php';

$ ckeditor = new CKEditor();
$ ckeditor-> basePath ='/ ckeditor /';
$ ckeditor-> config ['filebrowserBrowseUrl'] ='/ckfinder/ckfinder.html';
$ ckeditor-> config ['filebrowserImageBrowseUrl'] ='/ckfinder/ckfinder.html?type=Images';
$ ckeditor-> config ['filebrowserFlashBrowseUrl'] ='/ckfinder/ckfinder.html?type=Flash';
$ ckeditor-> config ['filebrowserUploadUrl'] ='/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
$ ckeditor-> config ['filebrowserImageUploadUrl'] ='/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images';
$ ckeditor-> config ['filebrowserFlashUploadUrl'] ='/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash';
$ ckeditor-> editor('CKEditor1');

?>

步骤7:你想要的名字,你可以通过改变步骤6来命名ckeditor代码最后一行

  $ ckeditor-> editor('mycustomname'); 

步骤8:打开page1.php,看到它,使用它,因为我们都喜欢开源。



感谢


how to add or embed CKEditor in php page, I downloaded and extracted the zip file into root of the directory and also called on my page

<?php require("ckeditor/ckeditor.php"); ?>

gave the textarea this fields

<textarea class="ckeditor" name="editor1">Write any thing</textarea>

But its not working, Documentation for installation on PHP is not found CKEditor website.

Does any one knows where we or help me out..for this app.

解决方案

Easy steps to Integrate ckeditor with php pages

step 1 : download the ckeditor.zip file

step 2 : paste ckeditor.zip file on root directory of the site or you can paste it where the files are (i did this one )

step 3 : extract the ckeditor.zip file

step 4 : open the desired php page you want to integrate with here page1.php

step 5 : add some javascript first below, this is to call elements of ckeditor and styling and css without this you will only a blank textarea

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

And if you are using in other sites, then use relative links for that here is one below

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

step 6 : now!, you need to call the work code of ckeditor on your page page1.php below is how you call it

<?php

// Make sure you are using a correct path here.
include_once 'ckeditor/ckeditor.php';

$ckeditor = new CKEditor();
$ckeditor->basePath = '/ckeditor/';
$ckeditor->config['filebrowserBrowseUrl'] = '/ckfinder/ckfinder.html';
$ckeditor->config['filebrowserImageBrowseUrl'] = '/ckfinder/ckfinder.html?type=Images';
$ckeditor->config['filebrowserFlashBrowseUrl'] = '/ckfinder/ckfinder.html?type=Flash';
$ckeditor->config['filebrowserUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
$ckeditor->config['filebrowserImageUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images';
$ckeditor->config['filebrowserFlashUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash';
$ckeditor->editor('CKEditor1');

?>

step 7 : what ever you name you want, you can name to it ckeditor by changing the step 6 code last line

$ckeditor->editor('mycustomname');

step 8 : Open-up the page1.php, see it, use it, share it and Enjoy because we all love Open Source.

Thanks

这篇关于如何在PHP页面中添加或嵌入CKEditor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆