Difference between revisions of "Assign prefix"
From TMM Wiki
Jump to navigationJump to searchm |
TMMStephenY (talk | contribs) m |
||
Line 32: | Line 32: | ||
[[Category:Also NATS4 Article]] | [[Category:Also NATS4 Article]] | ||
+ | [[Category:Common Parameters]] |
Latest revision as of 15:05, 31 May 2011
NATS 3
|
---|
CARMA
|
---|
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:
- {$encoded}
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,
- {$myprefix_encoded}
You should be able to use assign_prefix on any NATS4 template function that emits a variable and many CARMA functions.