如何设置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"
});
我已经解决了它,您必须将模式更改为模式:"text/x.php",