浏览代码

Document the <?= ?> syntax

bel 12 年之前
父节点
当前提交
392421d90c
共有 1 个文件被更改,包括 8 次插入3 次删除
  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