mirror of
https://github.com/cubixle/tuu.git
synced 2026-04-24 23:04:43 +01:00
SAVEPOINT
This commit is contained in:
@@ -8,16 +8,23 @@ import (
|
||||
"net/url"
|
||||
|
||||
"github.com/gobuffalo/buffalo/render"
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
func NewContext(r Route, res http.ResponseWriter, req *http.Request) *DefaultContext {
|
||||
data := make(map[string]interface{})
|
||||
data["path"] = r.Path
|
||||
|
||||
params := req.URL.Query()
|
||||
vars := mux.Vars(req)
|
||||
for k, v := range vars {
|
||||
params.Set(k, v)
|
||||
}
|
||||
|
||||
return &DefaultContext{
|
||||
response: res,
|
||||
request: req,
|
||||
params: req.URL.Query(),
|
||||
params: params,
|
||||
data: data,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user