Skip to content

Commit 65de0f1

Browse files
committed
Merge branch 'master' of https://github.com/thinkoner/thinkgo
2 parents b7b8a7e + e274df4 commit 65de0f1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
345351
views 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
376382
route.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

0 commit comments

Comments
 (0)