MCPcopy Create free account
hub / github.com/kataras/iris / createUser

Function createUser

_examples/routing/overview-2/main.go:117–132  ·  view source on GitHub ↗
(ctx iris.Context)

Source from the content-addressed store, hash-verified

115}
116
117func createUser(ctx iris.Context) {
118 var user User
119 err := ctx.ReadForm(&user)
120 if err != nil {
121 ctx.Values().Set("error", "creating user, read and parse form failed. "+err.Error())
122 ctx.StatusCode(iris.StatusInternalServerError)
123 return
124 }
125 // renders "./views/user/create_verification.html"
126 // with {{ . }} equals to the User object, i.e {{ .Username }} , {{ .Firstname}} etc...
127 ctx.ViewData("", user)
128 if err := ctx.View("user/create_verification.html"); err != nil {
129 ctx.HTML("<h3>%s</h3>", err.Error())
130 return
131 }
132}

Callers

nothing calls this directly

Calls 8

ReadFormMethod · 0.80
ViewDataMethod · 0.80
SetMethod · 0.65
ErrorMethod · 0.65
StatusCodeMethod · 0.65
ViewMethod · 0.65
ValuesMethod · 0.45
HTMLMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…