template-kit
template-kit copied to clipboard
Add containsKey tag
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.