Yii中引用插件和ckeditor body与P标签去除

来源:互联网 发布:手机淘宝上怎么开网店 编辑:程序博客网 时间:2024/06/06 16:29

在Yii中引用插件 



注:插件和扩展不一样



1,源码放在project/ckeditor/*
2,在代码create,update中引用
Php代码
<?php
include_once "/ckeditor/ckeditor.php";
// Create a class instance.
$CKEditor = new CKEditor();

// Path to the CKEditor directory.
$CKEditor->basePath = Yii::app()->baseUrl.'/ckeditor/';

// Replace a textarea element with an id (or name) of "textarea_id".
$CKEditor->replace("News_content");
?>




引入插件方法二:
第一,比如说,我们要使用 Zend framework的东西。我们把zend framework解压到 prtected/vendors里面,现在的文件夹为 protected/vendors/Zend/Search/Lucene.php

第二,在controller文件的头部,插入下面代码。
Yii::import(’application.vendors.*’);
require once(’Zend/Search/Lucene.php’);
上面代码包含了Lucene.php这个类文件。因为我们用到的是相对路径,所以我们需要改变PHP加载文件的路径,Yii::import 一定要在require_once 之前。

第三,一旦我们设置好了,我们就可以在controller里面使用了。比如说
$lucene=new Zend Search Lucene($pathOfIndex);
$hits=$lucene->find(strtolower($keyword));


项目中使用到了ckeditor ,但在比编辑框的下方多出两个标签,分别是一个 body与P标签,查询代码后发现不是我们自己增加,而是组件自己就有的问题


经过查询在使用的js申请处 新增 CKEDITOR.config.removePlugins='elementspath'; 就能去除掉此标签