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"
|
"net/url"
|
||||||
|
|
||||||
"github.com/gobuffalo/buffalo/render"
|
"github.com/gobuffalo/buffalo/render"
|
||||||
|
"github.com/gorilla/mux"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewContext(r Route, res http.ResponseWriter, req *http.Request) *DefaultContext {
|
func NewContext(r Route, res http.ResponseWriter, req *http.Request) *DefaultContext {
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
data["path"] = r.Path
|
data["path"] = r.Path
|
||||||
|
|
||||||
|
params := req.URL.Query()
|
||||||
|
vars := mux.Vars(req)
|
||||||
|
for k, v := range vars {
|
||||||
|
params.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
return &DefaultContext{
|
return &DefaultContext{
|
||||||
response: res,
|
response: res,
|
||||||
request: req,
|
request: req,
|
||||||
params: req.URL.Query(),
|
params: params,
|
||||||
data: data,
|
data: data,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user