Subversion-Projekte lars-tiefland.ci

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
776 lars 1
<!doctype html>
2
<title>CodeMirror: PHP mode</title>
3
<meta charset="utf-8" />
4
<link rel=stylesheet href="../../doc/docs.css">
5
<link rel="stylesheet" href="../../lib/codemirror.css">
6
<script src="../../lib/codemirror.js"></script>
7
<script src="../../addon/edit/matchbrackets.js"></script>
8
<script src="../htmlmixed/htmlmixed.js"></script>
9
<script src="../xml/xml.js"></script>
10
<script src="../javascript/javascript.js"></script>
11
<script src="../css/css.js"></script>
12
<script src="../clike/clike.js"></script>
13
<script src="php.js"></script>
14
<style type="text/css">
15
    .CodeMirror {
16
        border-top: 1px solid black;
17
        border-bottom: 1px solid black;
18
    }
19
</style>
20
<div id=nav>
21
    <a href="http://codemirror.net">
22
        <h1>CodeMirror</h1>
23
        <img id=logo src="../../doc/logo.png">
24
    </a>
25
    <ul>
26
        <li>
27
            <a href="../../index.html">Home</a>
28
            <li>
29
                <a href="../../doc/manual.html">Manual</a>
30
                <li>
31
                    <a href="https://github.com/codemirror/codemirror">Code</a>
32
    </ul>
33
    <ul>
34
        <li>
35
            <a href="../index.html">Language modes</a>
36
            <li>
37
                <a class=active href="#">PHP</a>
38
    </ul>
39
</div>
40
<article>
41
    <h2>PHP mode</h2>
42
    <form>
43
        <textarea id="code" name="code">
44
            <?php
45
$a = array('a' => 1, 'b' => 2, 3 => 'c');
46
 
47
echo "$a[a] ${a[3] /* } comment */} {$a[b]} \$a[a]";
48
 
49
function hello($who) {
50
	return "Hello $who!";
51
}
52
?>
53
                <p>The program says
54
                    <?= hello("World") ?>.</p>
55
                <script>
56
                    alert("And here is some JS code"); // also colored
57
                </script>
58
        </textarea>
59
    </form>
60
    <script>
61
        var editor = CodeMirror.fromTextArea(document.getElementById("code"),
62
        {
63
            lineNumbers: true,
64
            matchBrackets: true,
65
            mode: "application/x-httpd-php",
66
            indentUnit: 4,
67
            indentWithTabs: true
68
        });
69
    </script>
70
    <p>Simple HTML/PHP mode based on the
71
        <a href="../clike/">C-like</a> mode. Depends on XML, JavaScript, CSS, HTMLMixed, and C-like modes.</p>
72
    <p>
73
        <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>
74
</article>