如何在最新版本的codeigniter中集成tinymce

i am building a web application in codeigniter for that i need to integrate tinymce , i tried with following code but it's not working can some say what's wrong with the code

i created a view page called tinymce.php

    <script type="text/javascript" src="<?php echo $base_url; ?>js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",

// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,

// Drop lists for link/image/media/template dialogs
template_external_list_url : "js/template_list.js",
external_link_list_url : "js/link_list.js",
external_image_list_url : "js/image_list.js",
media_external_list_url : "js/media_list.js"
});
</script>

also added the textbox to display tinymce

    <form method="post" action="somepage">
<textarea name="content" style="width:100%">
</textarea>
</form>

then tried to load the view

$this->load->view('tinymce', base_url(), true);

the code not only working and it also not display my textarea.

Write your javascript code in view file itself. or simply write it in separate js file(tinymce_properties.js) and include it right after tiny_mce.js

<script type="text/javascript" src="js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="js/tiny_mce/tinymce_properties.js"></script>

<form method="post" action="somepage">
<textarea name="content" style="width:100%">
</textarea>
</form>

There are flaws in your code:

  1. $this->load->view() accepts second parameter as array while you are passing just base_url value.

  2. The true in third parameter of $this->load->view() function does not sends the output to browser so leave it blank.

  3. Make sure your paths to js paths are correct in the drop list code it seems that you have put the js in the view folder inside application.

Make sure all plugins your loading exists

try this ->> plugins : 'advlist autolink link image lists charmap print preview',

if it works, then you dont have all plugins in your statement ->> plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",