mirror of
https://github.com/kataras/iris.git
synced 2026-01-10 13:35:59 +00:00
fix #1876
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// Package main shows how you can register a custom parameter type and macro functions that belongs to it.
|
||||
// See _examples/routing/dynamic-path/main.go first.
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
@@ -53,7 +53,7 @@ func (dt *doneTODOs) Range() (reflect.Value, reflect.Value, bool) {
|
||||
func (dt *doneTODOs) ProvidesIndex() bool { return true }
|
||||
|
||||
func (dt *doneTODOs) Render(r *view.JetRuntime) {
|
||||
r.Write([]byte(fmt.Sprintf("custom renderer")))
|
||||
r.Write([]byte("custom renderer"))
|
||||
}
|
||||
|
||||
// Render implements jet.Renderer interface
|
||||
@@ -112,6 +112,7 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
ctx.ViewData("title", "Show TODO")
|
||||
ctx.View("todos/show.jet", todo)
|
||||
})
|
||||
app.Get("/all-done", func(ctx iris.Context) {
|
||||
@@ -122,7 +123,6 @@ func main() {
|
||||
// ctx.View("todos/index.jet", (&doneTODOs{}).New(todos))
|
||||
//
|
||||
// OR
|
||||
|
||||
ctx.ViewData("showingAllDone", true)
|
||||
ctx.ViewData("title", "Todos - All Done")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user