Closed smfoote closed 8 years ago
Do we need the $?
If possible, could you use the normal {} syntax? If it's not in the context, then you can look at the helperContext.
The $
is definitely not necessary from an implementation standpoint; we could build the helper context without it. However, I think it is important to have a clear delineation between the real context and the helper context, so that you can never accidentally use one when you meant to use the other.
Because Tornado does not allow you to look up the context, there needs to be a way to reference data outside of a sections's context. This can now be done with section params.
The section params are added to the helper context, and can be referenced by using the param name, prefixed with a
$
. For example:The helper context can now hold objects and arrays instead of just scalar values, and lookups on the helper context uses the same function as lookups on the normal context (which means functions are called and Promises are handled the same way).