The assign_prefix parameter to many NATS and CARMA functions lets you change output variable names. For example, the NATS4 template function, nats_encode creates the following variable:
Unfortunately, if you already have a Smarty variable named $encoded when you call nats_encode, the new value overwrites the old value. We designed assign_prefix to solve this problem. Call nats_encode with an argument to the assign_prefix parameter to have all of its output variables prefixed with your argument. For example: the following code,
- {nats_encode assign_prefix="myprefix_"}
puts the output in,
You should be able to use assign_prefix on any NATS4 template function that emits a variable and many CARMA functions.