Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From what I've read about Compojure, I don't think it has inherent support for the concept of "auto prepend" and "auto append" to the response body like PHP does. </p> <p>Other web frameworks with which I have experience delegate this responsibility to their templating engine, whereas PHP sort of blurs the lines a bit. They do this by allowing you to explicitly "include" a common snippet here, or render a macro, or even through rudimentary forms of inheritance (this template extends that template). </p> <p>Basically, whether your HTML is static or dynamic, a templating engine allows you to modularize for better maintainability.</p> <p>That said, Compojure doesn't appear to have a full-blown HTML templating engine bundled with it. It does have a nice little HTML/XML domain-specific language (DSL), but I think what you are looking for is more of a first class templating engine that can be used along with Compojure.</p> <p><a href="http://github.com/cgrand/enlive/tree/master" rel="noreferrer">Enlive</a> seems to be the Clojure-inspired templating engine that get the most hits, but I'm sure there are others. Given Clojure's JVM integration, you can probably pick from any of the <a href="http://java-source.net/open-source/template-engines" rel="noreferrer">Java-inspired templating engines</a> as well. </p> <p>Depending on which one you pick, there may be a few lines of glue code that you have to write to get your templates loaded, rendered and streamed into the Compojure HTTP responses, but you will write that once and reuse everywhere.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload