add web-functions

This commit is contained in:
Gered 2014-03-22 17:09:09 -04:00
parent 4cdf060750
commit 32a03b3507

View file

@ -0,0 +1,12 @@
(ns clj-jtwig.web.web-functions
"web functions, intended to be used by web applications only. most of these will require the
current servlet context path, so use of clj-jtwig.web.middleware.wrap-servlet-context-path
is a prerequisite for these functions."
(:require [clj-jtwig.web.middleware :refer [*servlet-context-path*]]))
; defined using the same type of map structure as in clj-jtwig.standard-functions
(defonce web-functions
{"path"
{:fn (fn [url]
(str *servlet-context-path* url))}})