【问题标题】:Set default language on a CodeMirror TextArea在 CodeMirror TextArea 上设置默认语言
【发布时间】:2013-08-13 19:03:44
【问题描述】:

如何设置 CodeMirror TextArea 在不回显标签的情况下理解 PHP?

文本区域

<textarea id="code" name="code">
  <?php
    echo '<?php';
  ?>
</textarea>

JS 脚本

var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
        lineNumbers: false,
        matchBrackets: true,
        mode: "application/x-httpd-php",
        indentUnit: 4,
        indentWithTabs: true,
        enterMode: "keep",
        tabMode: "shift"
    });

【问题讨论】:

  • 我已经解决了,你得把模式改成mode: "text/x-php",
  • 请将其作为答案发布,然后

标签: php javascript html textarea codemirror


【解决方案1】:

我已经解决了,你得把模式改成mode: "text/x-php",

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-08-02
    • 1970-01-01
    • 2016-09-07
    • 1970-01-01
    • 1970-01-01
    • 2022-06-23
    • 2020-12-21
    • 2012-06-02
    相关资源
    最近更新 更多