一区二区久久-一区二区三区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、創建helper,在/system/application/helpers新建form_helper.php

復制代碼 代碼如下:
<?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

復制代碼 代碼如下:
<?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技術CI框架中集成CKEditor編輯器的教程,轉載需保留來源!

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

主站蜘蛛池模板: 女人十八黄毛片 | 国产小视频在线免费观看 | caoliu在线 | 午夜视频在线免费播放 | 在线观看视频黄 | 六月丁香激情 | 亚洲网站视频在线观看 | 国产一区二区视频在线观看 | 玖玖在线播放 | 久久中文字幕2021精品 | 天天色天天 | 黄色免费在线观看 | 福利小视频在线播放 | 亚洲福利视频网站 | 狠狠综合久久综合88亚洲日本 | 成 人免费va视频 | 91成人在线 | 日本青草 | 91国在线产 | 在线国产一区二区三区 | 国产99久久精品一区二区 | 久久久91精品国产一区二区三区 | 国内精品视频在线播放一区 | 九九手机视频 | 天天综合网天天综合色不卡 | 亚洲精品高清国产一线久久97 | 久久国产精品只做精品 | 99国产精品一区二区 | 激情亚洲网| 欧美性在线播放 | 成人婷婷| 久久国产加勒比精品无码 | 欧美人禽猛交狂配免费看 | 伊人天天干 | 成人一级免费视频 | 日本一区二区三区中文字幕 | 五月综合激情网 | 国产婷婷综合在线视频中 | 欧美激情精品久久久久久大尺度 | 欧美一区二区三区精品国产 | 日韩激情文学 |