1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-07 20:17:05 +00:00

Add example of the powerful 'templ' generated templates

This commit is contained in:
Gerasimos (Makis) Maropoulos
2023-12-13 02:18:16 +02:00
parent 7ffe4010b9
commit 9279ca5a27
9 changed files with 359 additions and 8 deletions

View File

@@ -293,6 +293,14 @@ type (
FallbackViewLayout = context.FallbackViewLayout
)
// Component returns a new Handler which can be registered as a main handler for a route.
// It's a shortcut handler that renders the given component as HTML through Context.RenderComponent.
func Component(component context.Component) Handler {
return func(ctx Context) {
ctx.RenderComponent(component)
}
}
// PrefixDir returns a new FileSystem that opens files
// by adding the given "prefix" to the directory tree of "fs".
//