Skip to main content

resolve-arg

function

selmer.parser/resolve-arg

(resolve-arg [arg context-map])
Resolves an arg as passed to an add-tag! handler using the provided context-map. A custom tag handler will receive a seq of args as its first argument. With this function, you can selectively resolve one or more of those args so that if they contain literals, the literal value is returned, and if they contain templates of any sort, which can itself have variables, filters or tags in it, they will be returned resolved, applied and rendered. Example: (resolve-arg {{header-name|upper}} {:header-name "My Page"}) => "MY PAGE"

No examples yet. Be the first to add one!