@@ -17,13 +17,13 @@ By default Go lang provides set of [template functions](https://golang.org/pkg/t
17
17
Function | Description | Example
18
18
----------- | ----------- | --------
19
19
config | Accessing application configuration from ` aah.AppConfig() ` | ` {{ config "format.datetime" }} `
20
- include | Renders the common file from ` views/common ` with ViewArgs and imports into caller template file | ` {{ include "sidebar.html" . }} `
21
20
i18n | Access internationalization and localization message from view templates | ` {{ i18n . "label.pages.title.aboutus" }} `
22
21
pparam | Access Path parameter values | ` {{ pparam . "userId" }} `
23
22
fparam | Access Form parameter values | ` {{ fparam . "email" }} `
24
23
qparam | Access URL Query parameter values | ` {{ qparam . "lang" }} `
25
24
flash | Access Flash values. Note: Flash value is deleted after accessing once | ` {{ flash . "error.user.email.incorrect" }} `
26
25
session | Access Session object values | ` {{ session . "Username" }} `
26
+ include | Refer [ here] ( #func-include ) |
27
27
rurl | Create Route URL, Refer [ here] ( #func-rurl ) |
28
28
rurlm | Create Route URL, Refer [ here] ( #func-rurlm ) |
29
29
isauthenticated | Refer [ here] ( #func-isauthenticated ) |
@@ -35,6 +35,26 @@ ispermittedall | Refer [here](#func-ispermittedall) |
35
35
safeHTML | Refer [ here] ( #func-safehtml ) |
36
36
37
37
38
+ #### Func: include
39
+
40
+ Include and render template file from anywhere under ` <app-base-dir>/views/** ` sub-tree with ViewArgs.
41
+
42
+ <span class =" badge lb-sm " >Since v0.12.0</span > new behaviour introduced.
43
+
44
+ ``` html
45
+ {{ include "/common/sidebar.html" . }}
46
+
47
+ {{ include "/users/form.html" . }}
48
+ ```
49
+
50
+ Previous behaviour is deprecated, to be removed in subsequent future release.
51
+
52
+ ``` html
53
+ <!-- from common directory -->
54
+ {{ include "sidebar.html" . }}
55
+ ```
56
+
57
+
38
58
#### Func: rurl
39
59
40
60
Creates the Route URL for the given route name with arguments. Additional arguments are discarded.
0 commit comments