Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript TinyMCE或CKeditor与Zend的积分问题_Javascript_Jquery_Zend Framework_Tinymce_Ckeditor - Fatal编程技术网

Javascript TinyMCE或CKeditor与Zend的积分问题

Javascript TinyMCE或CKeditor与Zend的积分问题,javascript,jquery,zend-framework,tinymce,ckeditor,Javascript,Jquery,Zend Framework,Tinymce,Ckeditor,文件夹结构如下所示: Application -- Layouts ---- layout.phtml (the 'template' file which loads all the .phtml files into, like insert.phtml form the pages folder, and loads init.js) -- Modules ---- Admin ------ Views -------- Scripts ---------- Pages ---------

文件夹结构如下所示:

Application
-- Layouts
---- layout.phtml (the 'template' file which loads all the .phtml files into, like insert.phtml form the pages folder, and loads init.js)
-- Modules
---- Admin
------ Views
-------- Scripts
---------- Pages
------------ insert.phtml (the actual file where I want to use tinyMCE)
Library
Public
-- Tinymce
---- tiny_mc.js
-- Jquery
---- init.js (loads the tiny_mce.js file using this code:
$('.textEditor').Loader({
  url: ['../../../tinymce/tiny_mce.js'],
  debug: [true],
  cache: [true],
  success: function(target){
   tinyMCE.init({
    // General options
    mode : "textareas",
    theme : "advanced",
    editor_selector : "textEditor",
    plugins : "safari,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",

    // 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,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true,
   });
  }
 });
我使用Loader将其调用到textarea,如下所示:

Application
-- Layouts
---- layout.phtml (the 'template' file which loads all the .phtml files into, like insert.phtml form the pages folder, and loads init.js)
-- Modules
---- Admin
------ Views
-------- Scripts
---------- Pages
------------ insert.phtml (the actual file where I want to use tinyMCE)
Library
Public
-- Tinymce
---- tiny_mc.js
-- Jquery
---- init.js (loads the tiny_mce.js file using this code:
$('.textEditor').Loader({
  url: ['../../../tinymce/tiny_mce.js'],
  debug: [true],
  cache: [true],
  success: function(target){
   tinyMCE.init({
    // General options
    mode : "textareas",
    theme : "advanced",
    editor_selector : "textEditor",
    plugins : "safari,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",

    // 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,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true,
   });
  }
 });
当我查看控制台时,我得到以下信息:

Loading: ../../../tinymce/tiny_mce.js
Loaded: ../../../tinymce/tiny_mce.js (126ms)
/dgpcms/public/admin/pages/insert//langs/en.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/dgpcms/public/admin/pages/insert//plugins/style/editor_plugin.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/dgpcms/public/admin/pages/insert//plugins/layer/editor_plugin.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/dgpcms/public/admin/pages/insert//plugins/table/editor_plugin.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/dgpcms/public/admin/pages/insert//themes/advanced/editor_template.jsFailed to load resource: the server responded with a status of 404 (Not Found)
。。。。等等,所有插件

我怎样才能让tinyMCE忽略Zend应用程序的MVC结构? 或者如何解决这个问题

提前谢谢

这是在我的公用文件夹中找到的.htacces文件的内容:

SetEnv应用程序\环境开发

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule !\.(js|ico|gif|jpg|png|css|txt|swf)$ index.php
编辑:03-11-2010

更改了.htaccess文件中的某些内容,并将其更改回以前的设置方式(与上述情况相同),但错误已更改:

Loading: ../../../tinymce/tiny_mce.js
Loaded: ../../../tinymce/tiny_mce.js (230ms)
/langs/en.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/themes/advanced/editor_template.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/plugins/layer/editor_plugin.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/plugins/table/editor_plugin.jsFailed to load resource: the server responded with a status of 404 (Not Found)
/plugins/save/editor_plugin.jsFailed to load resource: the server responded with a status of 404 (Not Found)
所有插件都是如此

所以它现在在另一个文件夹中查找。有人知道吗

编辑:2010年11月5日

这真让我烦透了!我用CKeditor尝试过,但同样的问题也出现了。我试着在“RewriteEngine关闭”的情况下将一个.htaccess文件放在文件夹中(对于tinyMCE和CKeditor),但没有任何区别

编辑:22-11-2010


在我的布局文件中加载tinyMCE很有效。用这种方式不是最好的解决方案,但总比什么都没有好…

我想你应该把这个JS代码放到视图上,但我会做一些修改

    <?php
          $this->headScript()->captureStart();
                        /* insert some javascript here */
    $('.textEditor').Loader({
      url: [$this->baseUrl("tinymce/tiny_mce.js")],
      //// don't forget to add the rest of your javascript code here 
     });
         $this->headScript()->captureEnd();
    echo $this->headScript();
    ?>
你能不能不仅仅使用:

$('.textEditor').Loader({
    url: ['/tinymce/tiny_mce.js'],
    ...

这个问题没有真正的答案。因为这个问题,我的设置改变了很多。我使用Loader加载所有的texteditor设置,效果非常好。我不知道这个问题是否可以删除或关闭,但我不认为它会有助于


没有一个很好的答案(我认为两者的价值相等),所以我接受了这个答案,所以它在某种程度上得到了回答/关闭。

不,我不能,因为现在它没有指向tiny_mce.js文件为什么,你的tiny_mce.js文件的路径是什么?你也可以发布你的.htaccess…/../../tiny_mce.js文件的内容吗?我需要返回三个目录的。。。我的.htaccess文件的内容被添加到我的原始postook中,你的htaccess没有问题。您的vhost可能指向/dgpcms/public,对吗?但是,您需要使用绝对路径,忘记相对路径。我仍然不明白为什么/tinymce/tiny_mce.js不能工作-如果在浏览器中查看,会得到什么?显示js文件的内容,在控制台中没有任何错误…tiny_mce.js是从布局模板中调用的外部文件(init.js)调用的,因此我不能在代码中使用任何php。然后使用绝对url