一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

CI框架中集成CKEditor編輯器的教程

1、將fckeditor目錄置入CI_PATH/system/plugins/

2、在CI_PATH/system/application/config/config.php中加入:

$config['fckeditor_basepath'] = "/system/plugins/fckeditor/";
$config['fckeditor_toolbarset_default'] = 'Default';

3、創(chuàng)建helper,在/system/application/helpers新建form_helper.php

復(fù)制代碼 代碼如下:
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
include_once( BASEPATH . '/helpers/form_helper'.EXT);
function form_fckeditor($data = '', $value = '', $extra = '')
{
     $CI =& get_instance();
    $fckeditor_basepath = $CI->config->item('fckeditor_basepath');
     require_once( $_SERVER["DOCUMENT_ROOT"] . $fckeditor_basepath. 'fckeditor.php' );
    $instanceName = ( is_array($data) && isset($data['name'])   ) ? $data['name'] : $data;
    $fckeditor = new FCKeditor($instanceName);
     if( $fckeditor->IsCompatible() )
    {
         $fckeditor->Value = html_entity_decode($value);
        $fckeditor->BasePath = $fckeditor_basepath;
         if( $fckeditor_toolbarset = $CI->config->item('fckeditor_toolbarset_default'))
                $fckeditor->ToolbarSet = $fckeditor_toolbarset;
         if( is_array($data) )
        {
            if( isset($data['value']) )
                $fckeditor->Value = html_entity_decode($data['value']);
             if( isset($data['basepath']) )
                $fckeditor->BasePath = $data['basepath'];
             if( isset($data['toolbarset']) )
                $fckeditor->ToolbarSet = $data['toolbarset'];
             if( isset($data['width']) )
                $fckeditor->Width = $data['width'];
             if( isset($data['height']) )
                $fckeditor->Height = $data['height'];
        }
        return $fckeditor->CreateHtml();
    }
    else
    {
        return form_textarea( $data, $value, $extra );
    }
}
?>

4、在項目中使用fckeditor

復(fù)制代碼 代碼如下:
<?php
$this->load->helper('form_helper');
$data = array(
    'name'        => 'newsContent',
    'id'          => 'newsContent',
    //'toolbarset'  => 'Advanced',
    'basepath'    => $this->config->item('fckeditor_basepath'),
    'width'       => '80%',
    'height'      => '200'
);
echo form_fckeditor( $data );
?>

php技術(shù)CI框架中集成CKEditor編輯器的教程,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 超清中文乱码精品字幕在线观看 | 国产男人和女人做性全部视频 | 秋霞伊人| 美女胸又大又www又黄的网站 | 青青伊人91久久福利精品 | 欧美午夜在线 | 国产麻豆网 | 五月婷婷六月天 | 婷婷色站 | 亚洲伊人精品 | 欧美成人tv | 久久伊人中文字幕 | 色婷婷精品大全在线视频 | 国产第一第二第三第四第五 | 伊人激情久久综合中文字幕 | 高清不卡免费一区二区三区 | 在线日本妇人成熟免费观看 | 在线视频免费国产成人 | 日日噜噜噜噜人人爽亚洲精品 | 国模私拍福利一区二区 | 正在播放一区 | 久久不卡精品 | 国产91色在线 | 亚洲视频在线一区二区 | 美女全黄网站 | 99国产精品九九视频免费看 | 狠狠五月深爱婷婷网 | 亚洲天堂久久精品成人 | 黄色资源在线观看 | 青青国产成人久久激情91麻豆 | 亚洲综合热 | 91久久国产综合精品女同国语 | 在线观看一区二区三区四区 | 国产大臿蕉香蕉大视频 | 五月开心综合 | 久久福利青草精品免费 | 污污网站免费入口链接 | 婷婷伊人五月 | 久久国产综合 | 91国内在线视频 | 欧美成人高清免费大片观看 |