四虎精品视频-四虎精品成人免费网站-四虎黄色网-四虎国产视频-国产免费91-国产蜜臀97一区二区三区

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)系我們修改或刪除,多謝。

主站蜘蛛池模板: 吴京电影大全| 你是我心中的太阳泰剧| 坡道上的家| 回魂夜 电影| 心理健康《微笑的力量》ppt| 相识电影| 少女频道电影在线观看中文版| 国家干部电视剧| 忍者无敌| 思念天边的你简谱| xxxxxxcom| 一张图看懂军衔| 奇爱博士| 老牛家的战争电视剧全集免费观看 | 刀客家族| 暗夜尖叫1988美国版高清观看| 你是我的命运电影| 父母血型和孩子血型对照表| 年会不能停豆瓣评分| 吻胸亲乳激情大尺度| 阴道视频| 色戒在线观看汤唯| 陈学冬演过的电视剧有哪些| 爱欲1990未删减版播放| 男人和女人日b视频| 张晋个人资料和简历| 情义我心知| 我们的日子电视剧演员表| 乔治桑| outlander| 喜欢小红帽的原因怎么写| 地狱究竟有几层电影| 改朝换代| 转正意见发言简短| 寡妇激情| x档案第二季| 精神空虚贪图享乐具体表现及整改措施| 电影百度百科| 芦苇编剧| 思想理论问题| douying|