ad_export_vars (public, deprecated)
ad_export_vars [ -form ] [ -exclude exclude ] [ -override override ] \
[ include ]Defined in packages/acs-tcl/tcl/deprecated-procs.tcl
Deprecated. Invoking this procedure generates a warning.
Note This proc is deprecated in favor of
export_vars. They're very similar, butexport_varshave a number of advantages:It doesn't have the
- It can sign variables (the
:signflag)- It can export variables as a :multiple.
- It can export arrays with on-the-fly values (not pulled from the environment)
foo(bar)syntax to pull a single value from an array, however, but you can do the same by sayingexport_vars {{foo.bar $foo(bar)}}.Helps export variables from one page to the next, either as URL variables or hidden form variables. It'll reach into arrays and grab either all values or individual values out and export them in a way that will be consistent with the ad_page_contract :array flag.
Example:
will export the variabledoc_body_append [export_vars { msg_id user(email) { order_by date } }]msg_idand the valueuser, and it will export a variable namedorder_bywith the valuedate.The args is a list of variable names that you want exported. You can name
- a scalar variable,
foo,- the name of an array,
bar, in which case all the values in that array will get exported, or- an individual value in an array,
bar(baz)- a list in [array get] format { name value name value ..}. The value will get substituted normally, so you can put a computation in there.
A more involved example:
set my_vars { msg_id user(email) order_by } doc_body_append [export_vars -override { order_by $new_order_by } $my_vars]
- Switches:
- -form (optional, boolean)
- set this parameter if you want the variables exported as hidden form variables, as opposed to URL variables, which is the default.
- -exclude (optional)
- takes a list of names of variables you don't want exported, even though they might be listed in the args. The names take the same form as in the args list.
- -override (optional)
- takes a list of the same format as args, which will get exported no matter what you have excluded.
- Parameters:
- include (optional)
- Author:
- Lars Pind <lars@pinds.com>
- Created:
- 21 July 2000
- See Also:
- Testcases:
- No testcase defined.