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

Method View

iris.go:424–432  ·  view source on GitHub ↗

View executes and writes the result of a template file to the writer. First parameter is the writer to write the parsed template. Second parameter is the relative, to templates directory, template filename, including extension. Third parameter is the layout, can be empty string. Forth parameter is

(writer io.Writer, filename string, layout string, bindingData interface{})

Source from the content-addressed store, hash-verified

422// Use context.View to render templates to the client instead.
423// Returns an error on failure, otherwise nil.
424func (app *Application) View(writer io.Writer, filename string, layout string, bindingData interface{}) error {
425 if !app.view.Registered() {
426 err := errors.New("view engine is missing, use `RegisterView`")
427 app.logger.Error(err)
428 return err
429 }
430
431 return app.view.ExecuteWriter(writer, filename, layout, bindingData)
432}
433
434// GetContextPool returns the Iris sync.Pool which holds the contexts values.
435// Iris automatically releases the request context, so you don't have to use it.

Callers

nothing calls this directly

Calls 4

RegisteredMethod · 0.80
NewMethod · 0.80
ErrorMethod · 0.65
ExecuteWriterMethod · 0.65

Tested by

no test coverage detected