Guest User

Untitled

a guest
Mar 17th, 2012
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defpage "/welcome" []
  2.     (common/layout
  3.         (render (slurp "src/sfsb/views/welcome.html") {:name "somestring"})))
  4.  
  5. ;welcome.html contains:  <p>{{name}}</p>
  6.  
  7. (defpartial layout [& content]
  8.     (render (slurp "src/sfsb/views/common.html") {:html content} ))
  9.  
  10. ;common.html contains: <h2>testfirst</h2>{{html}}<h2>testlast</h2>
  11.  
  12. ; content contains the rendered template from defpage "/welcome"
  13. ; The output looks like this: testfirst("<p>somestring<p>")testlast
  14. ; 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