《PHP應用:Yii框架引用插件和ckeditor中body與P標簽去除的方法》要點:
本文介紹了PHP應用:Yii框架引用插件和ckeditor中body與P標簽去除的方法,希望對您有用。如果有疑問,可以聯系我們。
相關主題:YII框架
PHP學習本文實例講述了Yii框架引用插件和ckeditor中body與P標簽去除的方法.分享給大家供大家參考,具體如下:
PHP學習在Yii中引用插件
PHP學習注:插件和擴展不一樣
PHP學習1,源碼放在project/ckeditor/*
2,在代碼create,update中引用
PHP學習Php代碼
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");
?>
PHP學習引入插件方法二:
PHP學習第一,比如說,我們要使用 Zend framework的東西.我們把zend framework解壓到 prtected/vendors里面,現在的文件夾為 protected/vendors/Zend/Search/Lucene.php
PHP學習第二,在controller文件的頭部,插入下面代碼.
PHP學習
Yii::import('application.vendors.*');
require once('Zend/Search/Lucene.php');
PHP學習上面代碼包含了Lucene.php這個類文件.因為我們用到的是相對路徑,所以我們需要改變PHP加載文件的路徑,Yii::import 一定要在require_once 之前.
PHP學習第三,一旦我們設置好了,我們就可以在controller里面使用了.比如說
PHP學習
$lucene=new Zend Search Lucene($pathOfIndex);
$hits=$lucene->find(strtolower($keyword));
PHP學習項目中使用到了ckeditor ,但在比編輯框的下方多出兩個標簽,分別是一個 body與P標簽,查詢代碼后發現不是我們自己增加,而是組件自己就有的問題
PHP學習經過查詢在使用的js申請處 新增
PHP學習
CKEDITOR.config.removePlugins='elementspath';
PHP學習就能去除掉此標簽
PHP學習更多關于Yii相關內容感興趣的讀者可查看本站專題:《Yii框架入門及常用技巧總結》、《php優秀開發框架總結》、《smarty模板入門基礎教程》、《php面向對象程序設計入門教程》、《php字符串(string)用法總結》、《php+mysql數據庫操作入門教程》及《php常見數據庫操作技巧匯總》
PHP學習希望本文所述對大家基于Yii框架的PHP程序設計有所幫助.
轉載請注明本頁網址:
http://www.snjht.com/jiaocheng/1935.html