Browse Source

Document the <?= ?> syntax

bel 11 years ago
parent
commit
392421d90c
1 changed files with 8 additions and 3 deletions
  1. 8 3
      docs/UserManual.md

+ 8 - 3
docs/UserManual.md

@@ -350,13 +350,18 @@ the function mg.write(text).
 Lua Server Pages (default extensions: *.lsp, *.lp) are html pages containing
 Lua Server Pages (default extensions: *.lsp, *.lp) are html pages containing
 script elements similar to PHP, using the Lua programming language instead of
 script elements similar to PHP, using the Lua programming language instead of
 PHP. Lua script elements must be enclosed in `<?  ?>` blocks, and can appear
 PHP. Lua script elements must be enclosed in `<?  ?>` blocks, and can appear
-anywhere on the page. For example, to print current weekday name, one can
-write:
-
+anywhere on the page. Furthermore, Lua Server Pages offer the opportunity to
+insert the content of a variable by enclosing the Lua variable name in
+`<?=  ?>` blocks, similar to PHP.
+For example, to print current weekday name and the URI of the current page,
+one can write:
     <p>
     <p>
       <span>Today is:</span>
       <span>Today is:</span>
       <? mg.write(os.date("%A")) ?>
       <? mg.write(os.date("%A")) ?>
     </p>
     </p>
+    <p>
+      URI is <?=mg.request_info.uri?>
+    </p>
 
 
 Lua is known for it's speed and small size. Civetweb uses Lua version 5.2.2,
 Lua is known for it's speed and small size. Civetweb uses Lua version 5.2.2,
 the documentation for it can be found at
 the documentation for it can be found at