3

私は tinymce を統合する必要があるため、codeigniter で Web アプリケーションを構築しています。

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>

tinymceを表示するテキストボックスも追加しました

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

次に、ビューをロードしようとしました

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

コードは機能するだけでなく、テキストエリアも表示されません。

4

3 に答える 3

1

コードに欠陥があります:

  1. $this->load->view() は、2 番目のパラメーターを配列として受け入れますが、base_url 値だけを渡します。

  2. $this->load->view() 関数の 3 番目のパラメーターの true は、ブラウザーに出力を送信しないため、空白のままにします。

  3. ドロップ リスト コードで js パスへのパスが正しいことを確認してください。アプリケーション内のビュー フォルダーに js を配置したようです。

于 2013-01-19T08:25:44.403 に答える
0

ビューファイル自体にJavaScriptコードを記述します。または、別の js ファイル (tinymce_properties.js) に記述し、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>
于 2013-03-08T07:03:00.000 に答える
0

ロードしているすべてのプラグインが存在することを確認してください

これを試してください ->> プラグイン: 'advlist autolink link image lists charmap print preview',

それが機能する場合、ステートメントにすべてのプラグインが含まれているわけではありません ->> 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",

于 2014-02-14T07:51:01.150 に答える