quick server pages
   
Manual page for flow(of)

#if - #elseif - #else - #endif

Alter execution flow of control based on a conditional expression. #if statements can be nested.

if and endif are required. elseif and else are optional. An example of an if construct:

 #if @mode = A
    <h4>Mode is A</h4>
 #elseif @mode = B
    <h4>Mode is B</h4>
 #else
    <h4>Mode not given</h4>
 #endif

More examples:

 #if @tag = TOTAL
 #if @meas > 0.0 && @meas < 8.5
 #if @name = ""
 #if @type like "west*" || @type = "bl*"
 #if $arith(@A+@B) > 10



#exit

Terminate interpretation of the template immediately. Any content encountered up to the #exit will be displayed. Example:

 #if @_DEBUG = 1
     #exit
 #endif



#include

Include script code from a file. filename may be relative to your project ./pages dir; if not found there filename will be used directly. Includes may be nested. It is often very useful to have all of the pages in a project #include a common header at the top, and a common footer at the bottom. #include is also useful in sharing template code chunks that are utilized in more than one page, and for encapsulating external URL references that are used in more than one place.

Usage: #include file

#included code is interpreted in the same manner as ordinary code. However, #break and #continue may be used only if the corresponding loop / #endloop is also within the included file. #return may be used to immediately exit the included file and resume execution in the including file.

Security concern: user-supplied values (such as CGI user variables) should not be used to build the filename, unless proper measures are taken to detect and remove the ../ construct (used as a hack to see higher levels of the file system).

Example: #include projectheader


#return

Terminate execution of an #included file immediately. Execution is resumed in the including template, at the statement immediately following the #include.

Usage: #return


quick server pages    
Copyright Steve Grubb    


Markup created by unroff 1.0,    June 01, 2005.