#set $response.ContentType = "text/html"
Example Page
Example Page
This example does nothing useful, but illustrates some of the commands
you can use in the WebMacro script language.
Setting and getting a simple variable:
#set $myvar = "hello world"
My variable: $myvar
CGI Data:
- Script name: $cgi.SCRIPT_NAME
- Path info: $cgi.PATH_INFO
- Request method: $cgi.REQUEST_METHOD
- Path translated: $cgi.PATH_TRANSLATED
- Query string: $cgi.QUERY_STRING
Cookie data:
Hello cookie was: $cookie.hello.Value
(setting it to "i am a cookie")
#set $cookie.hello = "i am a cookie"
Access to FORM data:
Form variable "hi": $form.hi
Access list data:
Form variable "list": $form.list
#foreach $item in $form.list
{
- $item
}
Access config file data:
Default template directory: $config.Default_Template_Dir