中文字幕日韩一区二区_国产一区二区av_国产毛片av_久久久久国产一区_色婷婷电影_国产一区二区精品

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、在項(xiàng)目中使用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)載需保留來(lái)源!

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

主站蜘蛛池模板: 天天色影视综合 | 久久久久黑人 | 二区在线观看 | 中文字幕一页二页 | av毛片免费 | 亚洲乱码一区二区三区在线观看 | 国产成人综合在线 | 精品在线播放 | 久久久久久影院 | 97久久久久久久久 | 亚洲永久精品国产 | 亚洲第一成年免费网站 | 亚洲电影第1页 | 日韩免费高清视频 | aacc678成免费人电影网站 | 中文字幕一区二区三区乱码在线 | www免费视频| 91精品导航 | 精品国产乱码久久久久久1区2区 | 日韩在线观看一区 | 成人av网站在线观看 | 精品久久一 | 亚洲精品2 | 成人av播放 | 久久综合狠狠综合久久综合88 | 午夜一区二区三区在线观看 | 99成人| 国产精品观看 | 国产欧美精品一区二区三区 | 一区二区三区免费 | 18av在线播放 | 亚洲成人精品久久 | 丁香婷婷久久久综合精品国产 | 黄网站免费在线看 | 久久久久久久久久久久亚洲 | 91看片网 | 国产区在线 | 久久精品国产一区二区三区 | 国产乱码精品一区二区三区中文 | 亚洲一区视频在线 | 91免费在线视频 |