Example #1
0
File: starter.go Project: ssrl/gon
func renderDefault(context gon.WebContext, ret []reflect.Value, controllerName string, actionName string) {
	if model, ok := ret[0].Interface().(mv.Model); ok {
		context.WriteString(mustache.RenderFile(APP_VIEW_PATH+controllerName+"/"+actionName+".m", model))
	} else if view, ok := ret[0].Interface().(mv.View); ok {
		actionName = view.String()
		context.WriteString(mustache.RenderFile(APP_VIEW_PATH + controllerName + "/" + actionName + ".m"))
	}
}
Example #2
0
File: starter.go Project: ssrl/gon
func renderWithActionName(context gon.WebContext, ret []reflect.Value, controllerName string) {
	model := ret[0].Interface().(mv.Model)
	view := ret[1].Interface().(mv.View)
	actionName := view.String()
	context.WriteString(mustache.RenderFile(APP_VIEW_PATH+controllerName+"/"+actionName+".m", model))
}
Example #3
0
File: starter.go Project: ssrl/gon
func renderRoot(context gon.WebContext) {
	context.WriteString(mustache.RenderFile(APP_VIEW_PATH + "main.m"))
}