I am adding this public function since I find myself using template::adp_parse a lot and it's pretty unfriendly (in particular passing arrays by reference which is quite
useful with most of the more recent "get" functions
does not work unless you monkey with the template::adp_level
parse_level thing), not to mention that it's -private.
If anyone objects or wants to make any suggestions
now is the time...
template::adp_include [ -uplevel uplevel ] src varlist
Defined in packages/acs-templating/tcl/parse-procs.tclreturn a the output of a tcl/adp pair as a string. adp_level is
set to the calling procedure so that pass by reference works.
and example of using this is in the search indexer for various content
types:
bookshelf::book::get -book_id $book_id -array bookdata
set body [template::adp_include /packages/bookshelf/lib/one-book \
[list &book "bookdata" base $base style feed]]
The [list &book "bookdata" ...] tells adp_include to pass the book array by reference to the adp include, where it is
refered to via @book.field@.
- Switches:
-
-uplevel (defaults to
"1"
) (optional) - how far up the stack should the adp_level be set to
(default is the calling procedures level)
- Parameters:
-
src - should be the path to the tcl/adp pair relative to the server root, as
with the src attribute to the include tag.
varlist - a list of {key value key value ... } varlist can also be &var foo
for things passed by reference (arrays and multirows)
- Returns:
- the string generated by the tcl/adp pair.