-
Notifications
You must be signed in to change notification settings - Fork 0
FCKeditor
The following explains how to incorporate FCKeditor using Code Igniters 1.4x Libraries.
Place your FCKeditor files in you CI base directory (in this example I've put the files under a folder called plugins).
Copy FCKeditor's PHP connector file (fckeditor.php) to your applications libraries folder (/system/application/libraries), then add the following to the top of fckeditor.php:
[code] if (!defined('BASEPATH')) exit('No direct script access allowed'); [/code]
Now create an initialization file that corresponds to your FCKeditor PHP connector class. Your intialization file must be named identically to your class. In your application/init folder create a file called 'init_fckeditor.php' and add the following code:
[code] <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
if ( ! class_exists('FCKeditor')) { require_once(APPPATH.'libraries/fckeditor'.EXT); }
$obj =& get_instance(); $obj->fckeditor = new FCKeditor('FCKEDITOR1'); $obj->ci_is_loaded[] = 'fckeditor';
?> [/code]
The FCKeditor connector class should now be available in CI. Now simply load the library from your controller using:
[code] $this->load->library('fckeditor'); [/code]
And in your view file load the FCKeditor using the following:
[code]
<?php
$this->fckeditor->BasePath = base_url() . '/plugins/fckeditor/';
$this->fckeditor->Value = 'This is some sample text. You are using FCKeditor.' ;
$this->fckeditor->Create() ;
?>
[/code]
That's it! Hope this helps.
-Ralph The Seventh Letter
- Original author: Derek Jones
- How to extend helpers: See User Guide
- Modified by: Thomas Stapleton (id, classes, selected country option and all option)
- Modified by: Bradley De-Lar (construct, setLayout example)