File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -342,6 +342,12 @@ route.Get("/redirect", func(request *context.Request) *context.Response {
342342
343343## View
344344
345+ Specify the ` views ` directory before running the app:
346+
347+ ``` go
348+ view.ParseGlob (" /path/to/views/*" )
349+ ```
350+
345351views are stored in the ` views ` directory, A simple view might look something like this:
346352
347353` views/layout.html ` like this:
@@ -375,7 +381,7 @@ we may return it using the `Render` function like so:
375381``` go
376382route.Get (" /tpl" , func (request *context.Request ) *context.Response {
377383 data := map [string ]interface {}{" Title" : " ThinkGo" , " Message" : " Hello ThinkGo !" }
378- return thinkgo .Render (" tpl.html" , data)
384+ return view .Render (" tpl.html" , data)
379385})
380386```
381387
You can’t perform that action at this time.
0 commit comments