如何设置CodeMirror TextArea将理解PHP而不回显标签?
The Textarea
<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"
});
答案 0 :(得分:1)
我已经解决了,你必须将模式更改为模式:“text / x-php”,