Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defpage "/welcome" []
- (common/layout
- (render (slurp "src/sfsb/views/welcome.html") {:name "somestring"})))
- ;welcome.html contains: <p>{{name}}</p>
- (defpartial layout [& content]
- (render (slurp "src/sfsb/views/common.html") {:html content} ))
- ;common.html contains: <h2>testfirst</h2>{{html}}<h2>testlast</h2>
- ; content contains the rendered template from defpage "/welcome"
- ; The output looks like this: testfirst("<p>somestring<p>")testlast
- ; The actual html in common.html renders fine, where welcome.html comes out like this: ("<p>somestring</p>")
Advertisement
Add Comment
Please, Sign In to add comment