【发布时间】: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