template-kit icon indicating copy to clipboard operation
template-kit copied to clipboard

Add containsKey tag

Open jdanthinne opened this issue 6 years ago • 0 comments

When building forms (this is an example of the use of this tag, there can be many other), I usually tend to build a dictionary of validation errors as ["name_of_the_field": "This is the validation error to show"]. With this tag, when looping over my fields, I could just test if the dictionary contains a validation error for a given field with #if(containsKey(validationErrors, "name_of_the_field")) and then display the error if needed.

jdanthinne avatar May 22 '19 11:05 jdanthinne