Пример #1
0
//some jobs of controller was done by cache,rendering ought to be finished by controller
func (this *UserNav) Render(args *fragment.RenderArgs) template.HTML {
	//nil user,return a fixed string
	if args.User == nil {
		//lang can't be access when user == nil
		log4go.Debug("not login")
		return _user_nav_not_login
	}
	key := args.User.UserName
	return cache.Render("common/user_nav", key, args, this)
}
Пример #2
0
func (this *NavBar) Render(args *fragment.RenderArgs) template.HTML {
	return cache.Render("layout/nav_bar", "", args, this)
}