Example #1
0
//an example html page
func Index(txn *cheshire.Txn) {
	//create a context map to be passed to the template
	context := make(map[string]interface{})
	context["content"] = "Welcome to the wild(ing)!"

	//set a flash message
	cheshire.Flash(txn, "success", "this is a flash message!")

	//Render index template in layout
	cheshire.RenderInLayout(txn, "/public/index.html", "/layouts/base.html", context)
}
func Service(txn *cheshire.Txn) {
	//create a context map to be passed to the template
	context := make(map[string]interface{})

	service, ok := Servs.RouterTable(txn.Params().MustString("service", ""))
	context["service"] = service
	if !ok {
		cheshire.Flash(txn, "error", fmt.Sprintf("Cant find service"))
		cheshire.Redirect(txn, "/index")
		return
	}
	cheshire.RenderInLayout(txn, "/router_table.html", "/template.html", context)
}
func Log(txn *cheshire.Txn) {
	cheshire.RenderInLayout(txn, "/log.html", "/template.html", nil)
}
//an example html page
func Index(txn *cheshire.Txn) {
	//create a context map to be passed to the template
	context := make(map[string]interface{})
	context["services"] = Servs.RouterTables()
	cheshire.RenderInLayout(txn, "/index.html", "/template.html", context)
}