Skip to content

Commit 5727bb2

Browse files
committed
Enable use escape func in template
1 parent 96b47dd commit 5727bb2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ORDER BY /*% .order %*/id
3434
* func `in` deploy slice values to parentheses and placeholders.
3535
* func `time` returns current time and cache it, this func always same time in same template.
3636
* func `now` returns current time each calling.
37-
* func `prefix`, `inffix`, `suffix` replace to placeholder with escape for `LIKE` keyword.
37+
* func `escape`, `prefix`, `inffix`, `suffix` replace to placeholder with escape for `LIKE` keyword.
3838
* If you want customized time in template, you can set `TimeFunc`.
3939
* If database driver that you use supports `sql.NamedArg`, you should call `ExecNamed` func.
4040

context.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ func (c *context) funcMap() template.FuncMap {
228228
"prefix": c.prefix,
229229
"infix": c.infix,
230230
"suffix": c.suffix,
231+
"escape": c.escapeLike,
231232
}
232233
}
233234

0 commit comments

Comments
 (0)