yogthos/Selmer
Passing template variables to custom tags/filters?
Aberta
#78 aberto em 8 de abr. de 2015
enhancementhelp wanted
Métricas do repositório
- Stars
- (1.042 estrelas)
- Métricas de merge de PR
- (Nenhuma PRs mesclada em 30d)
Description
Hello, Is this possible?
E.g.
(selmer/add-tag! :getter
(fn [args context-map]
(let [field (first args)]
(str (if (= (:javaType field) "boolean") "is" "get") (:name field)))))
... or using a filter instead of the tag. And in the template:
{% for field in model.fields %}
{% getter field %}
{% endfor %}