Template Filters
1. Pull
pull methods
[ ' pull: value ' ]
1.1. csrf
[ ' csrf: login ' ]
1.2. db
[ ' db: pwd_min_chars ' ]
1.3. format_t
[ ' format_t: ForgotLink ' ]
1.4. href
[ ' href: properties ' ]
1.5. _t
[ ' _t: RealName ' ]
2. Escaper
provides five methods for escaping output. Which method to use depends on the context in which the output is used.
2.1. e
escape a string for an HTML body context
[ ' note | e ' ]
2.2. attr
escape a string for an HTML attribute context
[ ' username | e attr ' ]
2.3. css
escape a string for a CSS context
[ ' style | e css ' ]
2.4. js
escape a string for a Javascript context
[ ' javascritp | e js ' ]
2.5. url
escape a string for a URI or URI parameter context
[ ' url | e url ' ]
3. Filter
push methods
[ ' variable | filter1 | filter2 | ... ' ]
3.1. check
[ ' comments | check 2 ' ]
3.2. checkbox
[ ' minor | checkbox ' ]
3.3. date
3.4. dbg
3.5. default
[ ' delim | default '<br><br>' ' ]
3.6. enclose
[ ' count | enclose " (" ")" ' ]
3.7. e
see Escaper
3.8. format
3.9. hide_page
[ ' href | hide_page ' ]
3.10. index
3.11. join
3.12. json_decode
3.13. json_encode
3.14. list
[ ' watched | list WatchText UnwatchText | _t ' ]
3.15. lower
This filter converts any input to lowercase.
3.16. nl2br
[ ' preview | nl2br ' ]
3.17. number
[ ' page.hits | number 0 , . ' ]
3.18. number_format
[ ' page.hits | number_format ' ]
3.19. pre
[ ' data | pre ' ]
3.20. regex
[ ' search | regex /^[^?]*\?page=([^&]+).*?$/ '<input type="hidden" name="page" value="\1">' 1 1 ' ]
3.21. replace
[ ' a | replace desc uarr asc darr ' ]
3.22. select
[ ' listcount | select 10 ' ]
3.23. sp2nbsp
3.24. spaceless
3.25. split
3.26. stringify
3.27. striptags
This filter can strip XML and HTML tags from given content.
3.28. _t
3.29. time_format
[ ' page.created | time_format ' ]
3.30. trim
This filter modifies a given string such that certain characters are removed from the beginning and end.
[ ' t TabTitle | trim ' ]
3.31. truncate
[ ' timezone | truncate 50 ' ]
3.32. upper
This filter converts any input to UPPERCASE.
3.33. url_encode
3.34. void
['' commit | void // alternation hack '']