summaryrefslogtreecommitdiffstats
path: root/examples/examples.php
diff options
context:
space:
mode:
Diffstat (limited to 'examples/examples.php')
-rw-r--r--examples/examples.php28
1 files changed, 26 insertions, 2 deletions
diff --git a/examples/examples.php b/examples/examples.php
index 5c0c52e..467f405 100644
--- a/examples/examples.php
+++ b/examples/examples.php
@@ -88,7 +88,7 @@ $comment_statements = array(
?>
-<h1>Formatting</h1>
+<h1>Formatting And Syntax Highlighting</h1>
<div>
Usage:
@@ -99,7 +99,7 @@ $comment_statements = array(
<table>
<tr>
<th>Original</th>
- <th>Formatted</th>
+ <th>Formatted And Highlighted</th>
</tr>
<?php foreach ($statements as $sql) { ?>
<tr>
@@ -112,6 +112,30 @@ $comment_statements = array(
</table>
+<h1>Formatting Only</h1>
+
+<div>
+ Usage:
+ <pre>
+ <?php highlight_string('<?php' . "\n" . '$formatted = SqlFormatter::format($sql, false);' . "\n" . '?>'); ?>
+ </pre>
+</div>
+<table>
+ <tr>
+ <th>Original</th>
+ <th>Formatted</th>
+ </tr>
+ <?php foreach ($statements as $sql) { ?>
+ <tr>
+ <td>
+ <pre><?php echo $sql; ?></pre>
+ </td>
+ <td><pre><?php echo htmlentities(SqlFormatter::format($sql,false)); ?></pre></td>
+ </tr>
+ <?php } ?>
+</table>
+
+
<h1>Syntax Highlighting Only</h1>
<div>