Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
src
LICENSE
README.md
pom.xml

README.md

spark-template-jtwig

Spark templating system using Jtwig.

import static spark.Spark.get;

import java.util.HashMap;
import java.util.Map;

import spark.ModelAndView;

public class JtwigTemplateExample {
    public static void main(String[] args) {
        Map map = new HashMap();
        map.put("name", "Rafa");

        // hello.twig file is in resources/templates directory
        get("/hello", (rq, rs) -> new ModelAndView(map, "hello.twig"), new JtwigTemplateEngine());
    }
}