-
Notifications
You must be signed in to change notification settings - Fork 2
Preload
Thanatat Tamtan edited this page Sep 23, 2023
·
3 revisions
When some template have to use for multiple view, preload can be use in this case.
For example
t := app.Template()
t.ParseFiles("index", "index.tmpl", "layout.tmpl", "footer.tmpl").
t.ParseFiles("about-us", "about-us.tmpl", "layout.tmpl", "footer.tmpl")Can rewrite to use preload
t := app.Template()
t.Preload("layout.tmpl", "footer.tmpl").
t.ParseFiles("index", "index.tmpl").
t.ParseFiles("about-us", "about-us.tmpl")Next, see how to Config hime from file.
And see how to load html/template into template using Component