1 | <!doctype html> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <title>CodeMirror 2: PHP mode</title> |
---|
5 | <link rel="stylesheet" href="../../lib/codemirror.css"> |
---|
6 | <script src="../../lib/codemirror.js"></script> |
---|
7 | <script src="../xml/xml.js"></script> |
---|
8 | <link rel="stylesheet" href="../xml/xml.css"> |
---|
9 | <script src="../javascript/javascript.js"></script> |
---|
10 | <link rel="stylesheet" href="../javascript/javascript.css"> |
---|
11 | <script src="../css/css.js"></script> |
---|
12 | <link rel="stylesheet" href="../css/css.css"> |
---|
13 | <script src="../clike/clike.js"></script> |
---|
14 | <link rel="stylesheet" href="../clike/clike.css"> |
---|
15 | <script src="php.js"></script> |
---|
16 | <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> |
---|
17 | <link rel="stylesheet" href="../../css/docs.css"> |
---|
18 | </head> |
---|
19 | <body> |
---|
20 | <h1>CodeMirror 2: PHP mode</h1> |
---|
21 | |
---|
22 | <form><textarea id="code" name="code"> |
---|
23 | <?php |
---|
24 | function hello($who) { |
---|
25 | return "Hello " . $who; |
---|
26 | } |
---|
27 | ?> |
---|
28 | <p>The program says <?= hello("World") ?>.</p> |
---|
29 | <script> |
---|
30 | alert("And here is some JS code"); // also colored |
---|
31 | </script> |
---|
32 | </textarea></form> |
---|
33 | |
---|
34 | <script> |
---|
35 | var editor = CodeMirror.fromTextArea(document.getElementById("code"), { |
---|
36 | lineNumbers: true, |
---|
37 | matchBrackets: true, |
---|
38 | mode: "application/x-httpd-php", |
---|
39 | indentUnit: 8, |
---|
40 | indentWithTabs: true, |
---|
41 | enterMode: "keep", |
---|
42 | tabMode: "shift" |
---|
43 | }); |
---|
44 | </script> |
---|
45 | |
---|
46 | <p>Simple HTML/PHP mode based on |
---|
47 | the <a href="../clike/">C-like</a> mode. Depends on XML, |
---|
48 | JavaScript, CSS, and C-like modes.</p> |
---|
49 | |
---|
50 | <p><strong>MIME types defined:</strong> <code>application/x-httpd-php</code>.</p> |
---|
51 | </body> |
---|
52 | </html> |
---|