I am trying to allow php in the editor but it’s not working, I based it off of the php demo using application/x-httpd-php
but that is not working.
Resetting the modes to javascript, htmlmixed and css are all working fine, but php is throwing all kinds of errors when trying to edit/insert code.
// basing off of an option
<option data-lang="application/x-httpd-php">PHP</option>
// set the mode on select change (working, but not for php)
$(document).on('change', '.code-mode', function() {
var inner = $(this).closest('.widget-inner');
var language = $(this).find(':selected').attr('data-lang');
var editor = inner[0].editor;
editor.setOption("mode", language);
console.log(editor);
switch (language) {
case 'application/x-httpd-php':
inner.find('.new-inner').attr('data-language', 'php');
inner.find('.CodeMirror').attr('data-language', 'php');
break;
}
});
Here is my codepen: https://codepen.io/Souleste/pen/WVemXN?editors=1010