Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.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
Php 将codemirror与elfinder一起使用时,主题不起作用_Php_Codemirror_Elfinder - Fatal编程技术网

Php 将codemirror与elfinder一起使用时,主题不起作用

Php 将codemirror与elfinder一起使用时,主题不起作用,php,codemirror,elfinder,Php,Codemirror,Elfinder,我正在将elfinder与codemirror编辑器一起使用。当我在没有elfinder的情况下使用codemirror主题时,它工作得很好。但在elfinder主题中不起作用。以下是我使用的代码: $(document).ready(function() { $('#elfinder').elfinder({ url: 'path of connector file' // add more options here commandsOptions: { edit: { mime

我正在将elfinder与codemirror编辑器一起使用。当我在没有elfinder的情况下使用codemirror主题时,它工作得很好。但在elfinder主题中不起作用。以下是我使用的代码:

$(document).ready(function() {
 $('#elfinder').elfinder({
url: 'path of connector file'
// add more options here
commandsOptions: {
  edit: {
    mimes: ['text/plain', 'text/html', 'text/javascript','text/css','application/x-httpd-php'],
    editors: [{
      mimes: ['text/plain', 'text/html', 'text/javascript','text/css','application/x-httpd-php'],
      load: function(textarea) {
        var mimeType = this.file.mime;
        return CodeMirror.fromTextArea(textarea, {
          mode: mimeType,
          lineNumbers: true,
          indentUnit: 4,
          theme: "dracula",
         styleActiveLine: true,
            matchBrackets: true,
        });
      },
      save: function(textarea, editor) {
        $(textarea).val(editor.getValue());
      }
    }]
  }
  }
});
});

我已经包含了所有需要的css文件。请帮助解释为什么主题不起作用。

我正在解决这个问题。事实上,问题出在MIME中。现在,woeking代码是:

 $(document).ready(function() {
      $('#elfinder').elfinder({
       url: 'path of connector file'
     // add more options here
      commandsOptions: {
 edit: {

editors: [{
  mimes: [],
  load: function(textarea) {
    var mimeType = this.file.mime;
    return CodeMirror.fromTextArea(textarea, {
      mode: mimeType,
      lineNumbers: true,
      indentUnit: 4,
      theme: "dracula",
     styleActiveLine: true,
        matchBrackets: true,
    });
  },
  save: function(textarea, editor) {
    $(textarea).val(editor.getValue());
  }
    }]
    }
     }
        });
       });