1
0

index.html 1.5 KB

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