htp on-line reference : USE, $ |
||||||||
syntax
synopsisUSE will expand macros that have been previously declared with either SET or BLOCK. USE can only be used outside of other markup tags.If you USE a block macro the value of expanded block macros will be further parsed by htp. This is maybe not what you want, for example, if the use is inside a block which expands itself. You can use the noexpand attribute to prevent further expansion. USE will accept additional parameters, which are "local" macros for the expanded macro. This is only valid for BLOCK macros. Macros created using SET cannot have parameters passed. For example:
(See below for a description of the '$' operator.) The example on line 7 works because "stuff" has been declared as a block macro, and the tag is passing the "email" macro to the "stuff" macro. Line 8 fails because the "email" macro is unavailable once the block macro is completely expanded, and cannot be passed to a SET macro. Note that the "email" macro is available to other macros or included files called within the "stuff" block. Inside a markup tag, like IMG, A (anchor), or any other standard HTML or htp tag, the '$' operator must be used. The '$' should be immediately followed by the macro name, which may or may not be surrounded by curly braces. When htp encounters this it replaces the macro name by the contents of the macro without further processing the contents.
The use of curly braces is encouraged, since it is more robust and should never cause confusion with surrounding text. If no curly braces are used the macro name consists either of a single punctuation character or the maximum sequence of letters, digits, "-" and "_" that follows it. If a '$' character needs to be kept in the final output, and not interpreted as a macro name, it must be escaped by another '$' character. This is especially true for PHP code. If the '$' macro is the only text in the attribute's value, htp will automatically surround it with quotation marks to prevent spaces from delimiting the text as if it were additional markup attributes. If the '$' macro is surrounded by other text (as in the two examples above), quotation marks are not automatically supplied. Note that a '$' macro can be placed anywhere in a markup tag and can be nested. This is valid:
The tagName macro can contain any tag name, even a self-defined
metatag. Note that
|
||||||||
|
||||||||
htp on-line reference / http://htp.sourceforge.net/ref/
Authors: Jim Nelson, Jochen Hoenicke, Michael Möller. Maintainers: Jochen Hoenicke.
Copyright © 1995-96 Jim Nelson. last updated Tue Feb 22, 2011 |