Document the `|json` template modifier
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 20 Jan 2022 11:28:43 +0000 (12:28 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 20 Jan 2022 11:28:43 +0000 (12:28 +0100)
see WoltLab/WCF#4645

docs/view/template-plugins.md

index aa93714f26a0911af16ec111d781976f5bf817dc..34458520f5c0376987e86d9046d04ef015a8fd13 100644 (file)
@@ -462,6 +462,17 @@ require(['Language', /* … */], function(Language, /* … */) {
 ```
 
 
+## <span class="label label-info">5.5+</span> `json`
+
+`json` JSON-encodes the given value.
+
+```smarty
+<script>
+let data = { "title": {@$foo->getTitle()|json} };
+</script>
+```
+
+
 ## `lang`
 
 `lang` replaces a language items with its value.