coar 97/05/18 11:55:05
Modified: htdocs/manual/mod mod_include.html Log: Added documentation about use of {} in variable substitution. Revision Changes Path 1.11 +13 -0 apache/htdocs/manual/mod/mod_include.html Index: mod_include.html =================================================================== RCS file: /export/home/cvs/apache/htdocs/manual/mod/mod_include.html,v retrieving revision 1.10 retrieving revision 1.11 diff -C3 -r1.10 -r1.11 *** mod_include.html 1997/05/01 05:26:58 1.10 --- mod_include.html 1997/05/18 18:55:04 1.11 *************** *** 288,293 **** --- 288,306 ---- <!--#if expr="$a = \$test" --> </PRE> + <P> If a variable reference needs to be substituted in the middle of a + string, it can be done by enclosing the reference in braces, + <EM>á la</EM> shell substitution: + + <PRE> + <!--#set var="Zed" value="${REMOTE_HOST}_${REQUEST_METHOD}" --> + </PRE> + + <P> will result in the <SAMP>Zed</SAMP> variable being set to + "<SAMP>X_Y</SAMP>" if <SAMP>REMOTE_HOST</SAMP> is + "<SAMP>X</SAMP>" and <SAMP>REQUEST_METHOD</SAMP> is + "<SAMP>Y</SAMP>". + <P> EXAMPLE: the below example will print "in foo" if the DOCUMENT_URI is /foo/file.html, "in bar" if it is /bar/file.html and "in neither" otherwise: