ns_adp_include - Parse an ADP file and return its output
This command parses the specified file as an ADP, including the text blocks and any output generated by script blocks in the current output buffer. The execution occurs in a new call frame with private local variables similar to a Tcl procedure. The filename is the file containing the ADP to be parsed. If the file is not an absolute filename, the file is considered relative to the current ADP working directory which is the directory of the previously included file. Optional arguments (arg...) can be passed to the included ADP; see the ns_adp_argv command above for details on accessing the values of these variables. The optional -cache seconds argument specifies the time to cache the results of execution. All output generated by any scripts and included ADP's are saved for subsequent requests unless an included ADP has a -nocache option. The use of -cache and -nocache can be used to increase performance of ADP used to generated a mix of personalized, non-cacheable, content and shared content which changes more slowly. Under high load, the performance improvement can be substaintial, especially in cases where the cached content is the result of accessing a slow databases or web services. See the EXAMPLES section for an example of using cached output.
ADPs can be nested by including each other up to the maximum of 256 levels deep.
This command is only available from an ADP. Use ns_adp_parse to parse ADPs from outside the context of an ADP.
-tcl Given file is .tcl file and should be wrapped into ADP page -nocache Do not cache ADP page results -cache seconds Cache results for this amount of time
### ### Example #1: Callee outputs directly to ADP output buffer. ### # In a.adp: <% ns_adp_include b.adp %> # In b.adp: <% ns_adp_puts "Hello, world!" %> ### ### Example #2: Caller outputs to ADP buffer. ### # In a.adp: <% ns_adp_puts ns_adp_include arg b.adp %> # In b.adp: <% return "Hello, world!" %>
ns_adp_abort, ns_adp_append, ns_adp_argc, ns_adp_argv, ns_adp_bind_args, ns_adp_break, ns_adp_debug, ns_adp_debuginit, ns_adp_dir, ns_adp_dump, ns_adp_eval, ns_adp_exception, ns_adp_mime, ns_adp_mimetype, ns_adp_parse, ns_adp_puts, ns_adp_registeradp, ns_adp_registerproc, ns_adp_registertag, ns_adp_return, ns_adp_safeeval, ns_adp_stats, ns_adp_stream, ns_adp_tell, ns_adp_trunc