Example #1
0
func NewWSContext(c subs.Context, web *Web) WSContext {
	return &defaultWSContext{
		Context:      c,
		web:          web,
		translations: translation.GetTranslations(GetLanguage(c.Conn().Request())),
	}
}
Example #2
0
func (self *Web) GetContext(w http.ResponseWriter, r *http.Request) (result *HTTPContext) {
	result = &HTTPContext{
		response:     w,
		request:      r,
		web:          self,
		translations: translation.GetTranslations(GetLanguage(r)),
		vars:         mux.Vars(r),
	}
	result.session, _ = self.sessionStore.Get(r, SessionName)
	return
}