diff options
author | P. J. McDermott <pjm@nac.net> | 2013-09-30 10:02:43 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2013-09-30 10:06:37 (EDT) |
commit | 608ad6ec81778d9122c27e341387885e8255e42b (patch) | |
tree | e81eb1d77585ab2e08749d4b3e3810f448fd0b50 /README | |
parent | 8459f282e35e069088d66b8eac22173f82ed82c5 (diff) | |
download | ssic-608ad6ec81778d9122c27e341387885e8255e42b.zip ssic-608ad6ec81778d9122c27e341387885e8255e42b.tar.gz ssic-608ad6ec81778d9122c27e341387885e8255e42b.tar.bz2 |
README: Document flow control commands.
Diffstat (limited to 'README')
-rw-r--r-- | README | 44 |
1 files changed, 44 insertions, 0 deletions
@@ -71,6 +71,50 @@ The following variables are set: * `DOCUMENT_URI` is the current filename. * `LAST_MODIFIED` is the modification date of the current document. +Flow Control Commands +--------------------- + +The flow control commands are: + + <!--#if expr="test_expression" --> + <!--#elif expr="test_expression" --> + <!--#else --> + <!--#endif --> + +If `test_expression` evaluates to false, processing of basic commands is +suspended until the next `elif`, `else`, or `endif` is encountered. If +`test_expression` evaluates to true, processing of basic commands is +suspended between any following `elif` or `else` commands and the next +`endif` command. + +`test_expression` is a Perl expression, which is passed to Perl's +`eval()` function. Variables may be expanded but should be quoted. + +The following example will output "foo is bar" if the variable `foo` is +set to the value "bar": + + <!--#if expr="'$foo' eq 'bar'" --> + foo is bar + <!--#endif --> + +The following example checks the SSI interpreter and uses the correct +expression syntax for either ssic or Apache HTTPd 2.2 `mod_include`: + + <!--#if expr="'$__SSIC__' eq '__SSIC__'" --> + <!-- Apache HTTPd 2.2 mod_include --> + <!--#if expr="$foo = 'bar'" --> + foo is bar + <!--#endif --> + <!--#else --> + <!-- Server Side Includes Compiler --> + <!--#if expr="'$foo' eq 'bar'" --> + foo is bar + <!--#endif --> + <!--#endif --> + +This is the recommended way to check the value of the variable +`__SSIC__`. + Copyright Information ===================== |